Difference between revisions of "SYSCOLUMNS"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) (→Description) |
||
Line 49: | Line 49: | ||
|} | |} | ||
− | Return values for field types | + | Return values for Lianja field types are shown in the table below. |
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" |
Latest revision as of 13:21, 6 December 2021
Contents
Purpose
Description of the table columns available in the catalog
See Also
DATA TYPES, SELECT, SYSTEM TABLES
Description
System Tables are system defined read-only tables. You can query these tables using the SELECT statement.
Column | Data Type | Width | Description |
---|---|---|---|
TABLE_CAT | C | 30 | Table catalog |
TABLE_SCHEM | C | 30 | Table schema |
TABLE_NAME | C | 30 | Table name |
COLUMN_NAME | C | 25 | Column name |
DATA_TYPE | N | 2 | SQL data type |
TYPE_NAME | C | 30 | Data source dependent type name |
COLUMN_SIZE | N | 3 | Precision |
BUFFER_LENGTH | L | 1 | Reserved |
DECIMAL_DIGITS | N | 2 | Scale |
NUM_PREC_RADIX | N | 2 | Radix (typically either 10 or 2) |
NULLABLE | N | 2 | Is NULL allowed? |
REMARKS | C | 25 | Comment describing column |
COLUMN_DEF | C | 30 | Default value |
SQL_DATA_TYPE | N | 1 | Reserved |
SQL_DATETIME_SUB | N | 1 | Reserved |
CHAR_OCTET_LENGTH | N | 1 | For char types the maximum number of bytes in the column |
ORDINAL_POSITION | N | 4 | Index of column in table (starting at 1) |
IS_NULLABLE | C | 3 | "NO" means column definitely does not allow NULL values; "YES" means the column might allow NULL values. An empty string means unknown. |
Return values for Lianja field types are shown in the table below.
Field Type | TYPE_NAME | DATA_TYPE |
---|---|---|
Character | CHAR | 1 |
Numeric | NUMERIC | 2 |
Logical | BOOLEAN | -7 |
Varchar | LONG VARCHAR | -4 |
Blob | LONG VARBINARY | -4 |
Currency | CURRENCY | 0 |
Date | DATE | 91 |
Datetime | DATETIME | 93 |
Int | INTEGER | 2 |
Float | FLOAT | 8 |
Short | SHORT | 5 |
Real | REAL | 7 |
Json | LONG VARCHAR | -4 |
Example
SELECT * FROM syscolumns; WHERE type_name = 'DATETIME'