Difference between revisions of "SYSCOLUMNS"

From Lianjapedia
Jump to: navigation, search
m (1 revision: SQL)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Description of the table columns available in the catalog
 
Description of the table columns available in the catalog
 
  
 
==See Also==
 
==See Also==
 
[[SQL Data Types|DATA TYPES]], [[SQL SELECT|SELECT]], [[SQL System Tables|SYSTEM TABLES]]
 
[[SQL Data Types|DATA TYPES]], [[SQL SELECT|SELECT]], [[SQL System Tables|SYSTEM TABLES]]
 
  
 
==Description==
 
==Description==
 
System Tables are system defined read-only tables. You can query these tables using the SELECT statement.
 
System Tables are system defined read-only tables. You can query these tables using the SELECT statement.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 51: Line 48:
 
|-
 
|-
 
|}
 
|}
 
  
 
==Example==
 
==Example==
Line 59: Line 55:
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]
 
[[Category:System Tables]]
 
[[Category:System Tables]]

Revision as of 10:52, 7 December 2012

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.

Example

SELECT * FROM syscolumns;
WHERE type_name = 'DATETIME'