COLUMNS
Provides table column information. For columns of Iceberg external tables, see ICEBERG_COLUMNS.
Column Name | Data Type | Description |
---|---|---|
TABLE_ID |
INTEGER | Catalog-assigned numeric value that uniquely identifies the table. |
TABLE_NAMESPACE |
VARCHAR | For Eon Mode databases, name of the namespace that contains the table. |
TABLE_SCHEMA |
VARCHAR |
Name of the table's schema. If the schema belongs to a non-default namespace in an Eon Mode database, the schema name is front-qualified with the name of the schema's namespace. For example, |
TABLE_NAME |
VARCHAR | Name of the table containing the column. |
IS_SYSTEM_TABLE |
BOOLEAN | Whether the table is a system table. |
COLUMN_ID |
VARCHAR | Catalog-assigned VARCHAR value that uniquely identifies a table column. |
COLUMN_NAME |
VARCHAR | Name of the column. |
DATA_TYPE |
VARCHAR |
Column data type. Arrays of primitive types show the name |
DATA_TYPE_ID |
INTEGER | Catalog-assigned unique numeric ID of the data type. |
DATA_TYPE_LENGTH |
INTEGER | Maximum allowable length of the data type. |
CHARACTER_MAXIMUM_LENGTH |
VARCHAR | Maximum allowable length of a VARCHAR column. |
NUMERIC_PRECISION |
INTEGER | Number of significant decimal digits for a NUMERIC column. |
NUMERIC_SCALE |
INTEGER | Number of fractional digits for a NUMERIC column. |
DATETIME_PRECISION |
INTEGER | Declared precision for a TIMESTAMP column, or NULL if no precision was declared. |
INTERVAL_PRECISION |
INTEGER | Number of fractional digits retained in the seconds field of an INTERVAL column. |
ORDINAL_POSITION |
INTEGER | Column position respective to other columns in the table. |
IS_NULLABLE |
BOOLEAN | Whether the column can contain NULL values. |
COLUMN_DEFAULT |
VARCHAR | Expression set on a column with the DEFAULT constraint. |
COLUMN_SET_USING |
VARCHAR | Expression set on a column with the SET USING constraint. |
IS_IDENTITY |
BOOLEAN | Whether the column is an IDENTITY column. |
Examples
In the following query, datetime_precision
is NULL because the table definition declares no precision:
In the following example, timestamp precision is set:
An IDENTITY column sequence is defined in a table's DDL. Column values automatically increment as new rows are added. The following query returns identity columns:
You can query the SEQUENCES table to get detailed information about an IDENTITY column sequence:
For details about sequences and IDENTITY columns, see Sequences.