The USER_TAB_COLS view lists the columns of all tables and views accessible to the current account, including each column's data type, length, precision, and nullability.
Note
USER_TAB_COLS returns the same information as the USER_TAB_COLUMNS view. Query USER_TAB_COLS on PolarDB clusters running version 1.1.7 or later. For clusters running earlier versions, query USER_TAB_COLUMNS instead. For more information, see Release notes and USER_TAB_COLUMNS.
Columns
| Column | Type | Description |
|---|---|---|
schema_name | CHARACTER VARYING | The name of the schema that contains the table or view. |
table_name | CHARACTER VARYING | The name of the table or view. |
column_name | CHARACTER VARYING | The name of the column. |
data_type | CHARACTER VARYING | The data type of the column. |
data_length | NUMERIC | The maximum length of the column data, in characters. |
data_precision | NUMERIC | The precision of NUMBER columns, measured in digits. |
data_scale | NUMERIC | The scale of NUMBER columns. |
nullable | CHARACTER(1) | Specifies whether the column accepts null values. Valid values: Y (nullable) and N (not nullable). |
column_id | NUMERIC | The ordinal position of the column within the table or view. |
data_default | CHARACTER VARYING | The default value of the column. |