B.3 Content of SQL_COLUMNS
SQL_COLUMNS stores column definition information of base tables, viewed tables, dictionary tables, dictionary tables (base tables), system tables, system tables (base tables). Each row stores information for one column.
The following table describes the content of SQL_COLUMNS.
No. |
Column name |
Data type |
Stored information |
---|---|---|---|
1 |
TABLE_SCHEMA |
VARCHAR(100) |
Schema name |
2 |
TABLE_NAME |
VARCHAR(100) |
Table identifier |
3 |
COLUMN_NAME |
VARCHAR(100) |
Column name |
4 |
COLUMN_ID |
SMALLINT |
Column ID |
5 |
TABLE_ID |
SMALLINT |
Table ID:
|
6 |
DATA_TYPE_CODE |
SMALLINT |
Column data type:
|
7 |
DATA_LENGTH |
SMALLINT |
Column definition length:
|
8 |
IS_NULLABLE |
CHAR(1) |
Whether the NOT NULL constraint was specified for the column:
In the case of a FIX table, all columns default to 'N'. |
9 |
COLUMN_OFFSET |
SMALLINT |
|
10 |
BRANCH |
CHAR(1) |
BRANCH specification value in column definition:
For columns whose type is not VARCHAR or VARBINARY, the null value is stored. The null value is also stored for columns in a column store table. |
11 |
DEFAULT_VALUE |
VARCHAR(32000) |
Default value specified in the DEFAULT clause Stores the default value that was specified in the DEFAULT clause when a base table was defined.
For columns of viewed tables, columns of dictionary tables (base tables), columns of system tables (base tables), and columns of base tables without the DEFAULT clause specified, the null value is stored. |
12 |
IS_DEFAULT_COLUMN |
CHAR(1) |
Whether the DEFAULT clause is specified
The null value is stored also for columns of viewed tables, columns of dictionary tables (base tables), and columns of system tables (base tables). |
13 |
IS_PRIMARY_KEY_COLUMN |
CHAR(1) |
Whether a column comprises the primary key
The null value is stored also for columns of viewed tables, columns of dictionary tables (base tables), and columns of system tables (base tables). |
14 |
PRIMARY_KEY_COLUMN_SEQUENCE_NUMBER |
SMALLINT |
|
15 |
N_FOREIGN_KEY_COLUMN |
SMALLINT |
|
16 |
IS_ARCHIVE_RANGE_COLUMN |
CHAR(1) |
Is archive range column?
The null value is stored for the following columns:
|
17 |
COMPRESSION_TYPE |
VARCHAR(32) |
|
The following table describes the value that is stored in the DEFAULT_VALUE column when a literal is specified in the DEFAULT clause.
No. |
Data type assumed for the default value |
Value that is stored in the DEFAULT_VALUE column |
||
---|---|---|---|---|
Data length (bytes) |
Example of character format for the value that is stored |
|||
1 |
Numeric data |
INTEGER |
Length of the specified default value that has been converted to character format |
12345 |
2 |
SMALLINT |
12345 |
||
3 |
DECIMAL |
12.345 |
||
4 |
DOUBLE PRECISION |
-1234567890.1234567E-123 |
||
5 |
Character string data |
CHAR |
Length of the specified default value that has been converted to character format + 2 |
'ABCD' |
6 |
VARCHAR |
|||
7 |
Datetime data |
DATE |
16 |
DATE'YYYY-MM-DD' |
8 |
TIME(p) |
|
TIME'hh:mm:ss.nn...n'#1, #2 |
|
9 |
TIMESTAMP(p) |
|
TIMESTAMP'YYYY-MM-DDΔhh:mm:ss.nn....n'#1,#2 |
|
10 |
Binary data |
BINARY |
|
|
11 |
VARBINARY |
- Legend:
-
p: Fractional seconds precision (0, 3, 6, 9, or 12)
YYYY: Year
MM: Month
DD: Date
Δ: Space
hh: Hour
mm: Minute
ss: Second
nn...n: Fraction of a second
- #1
-
If the fractional seconds precision of the column for which the DEFAULT clause is specified is zero, the period (.) between the second value (ss) and the fraction of a second (nn...n) is omitted.
- #2
-
If the fractional seconds precision of the default value is shorter than the number of digits in the fraction of a second (nn...n) for the column for which the DEFAULT clause is specified, trailing zeros are padded to fill the length.
If the fractional seconds precision of the default value is greater than the number of digits in the fraction of a second (nn...n) for the column for which the DEFAULT clause is specified, the value is truncated.