## Data Type (data_type)

A column definition (column_definition) can contain both the column name (column_name) and data types.

The following data types can be distinguished:

● NULL value

● Special NULL Value

● Non-NULL values

Character string, LONG column, Number, Date value, Time value, Timestamp value, BOOLEAN

The non-NULL values can be specified using the syntax element data_type.

### Syntax

<data_type> ::=
CHAR[ACTER] [(<unsigned_integer>)] [ASCII | BYTE | UNICODE]
| VARCHAR[(<unsigned_integer>)] [ASCII | BYTE | UNICODE]
| LONG [VARCHAR] [ASCII | BYTE | UNICODE]
| BOOLEAN
| FIXED(<unsigned_integer> [,<unsigned_integer>])
| FLOAT(<unsigned_integer>)
| INT[EGER]
| SMALLINT4
| DATE | TIME | TIMESTAMP

A code attribute can also be specified for the following character strings (ASCII, BYTE, or UNICODE) as part of a column definition (column_definition) if necessary: CHAR[ACTER], VARCHAR, LONG[VARCHAR]

### 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 VARCHAR | LONG
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)

See also:

Memory Requirements of a Column Value According to Data Type

SQL Tutorial, Converting Values