A column definition (column_definition) can contain both the column name ( column_name) and data types.
The following data types can be distinguished:
Non- NULL values
Character String, LOB Column (CLOB, BLOB), Number, Date Value, Time Value, Time Stamp Value, BOOLEAN
The non- NULL values can be specified using the syntax element data_type.
<data_type>::= <CHAR[ACTER]> [(<<unsigned_integer>>)] [<ASCII | BYTE | UNICODE>] | <VARCHAR>[(<unsigned_integer>)] [ASCII | BYTE | UNICODE] | <CLOB> [ASCII | UNICODE] | <BLOB> | <BOOLEAN> | <FIXED> (<unsigned_integer> [,<unsigned_integer>]) | <FLOAT> (<unsigned_integer>) | <INT[EGER]> | <SMALLINT> | <DATE> | <TIME> | <TIMESTAMP>
For more information on ASCII, BYTE or UNICODE, see the section Code Attribute.
Examples
SQL Tutorial, Tables, Number Generator for a Single Column of a Table
Explanation
In addition to the data types defined above, the following data types are also permitted in a column definition. The table below also indicates the way these are mapped to the above-mentioned data types.
Data Type |
Is Mapped To |
---|---|
BINARY(p) |
FIXED(p) |
DEC[IMAL](p,s) |
FIXED(p,s) |
DEC[IMAL](p) |
FIXED(p) |
DEC[IMAL] |
FIXED(5) |
DOUBLE PRECISION |
FLOAT(38) |
FLOAT |
FLOAT(16) |
FLOAT(39..64) |
FLOAT(38) |
LONG [ASCII] |
CLOB |
LONG BYTE |
BLOB |
LONG UNICODE |
CLOB UNICODE |
LONG VARCHAR |
CLOB |
NCHAR(p) |
CHAR(p) UNICODE |
NCLOB |
CLOB UNICODE |
NVARCHAR(p) |
VARCHAR(p) UNICODE |
NUMERIC(p,s) |
FIXED(p,s) |
NUMERIC(p) |
FIXED(p) |
NUMERIC |
FIXED(5) |
REAL(p) |
FLOAT(p) |
REAL |
FLOAT(16) |
SERIAL |
FIXED(10) DEFAULT SERIAL |
SERIAL(p) |
FIXED(10) DEFAULT SERIAL(p) |