UltraLite Database User's Guide
SQL Language Elements
The following are the SQL data types supported in UltraLite databases.
If you create an UltraLite database from an Adaptive Server Anywhere reference database, you can use other data types, including user-defined data types, in the reference database. The UltraLite generator casts those data types into a data type supported in UltraLite databases. You cannot use user-defined data types that include DEFAULT values or CHECK constraints.
If you use dynamic SQL, or if you design an UltraLite database using the Schema Painter, you are limited to the use of the types listed here.
For data types in Adaptive Server Anywhere, see SQL Data Types.
Data type | Remarks |
---|---|
{CHAR|CHARACTER} [( max-length )] |
Character data of maximum length max-length characters. The maximum length is 2048 bytes. See CHAR data type [Character] |
{VARCHAR | CHARACTER VARYING} [( max-length )] |
In UltraLite, VARCHAR is implemented identically to CHAR. In other databases, VARCHAR is used for variable-length character data of maximum length max-length. See CHARACTER VARYING (VARCHAR) data type [Character] |
[UNSIGNED] BIGINT |
An integer requiring 8 bytes of storage. See BIGINT data type [Numeric] |
{DECIMAL | DEC} [( precision [,scale] )] |
A decimal number with precision total digits and with scale of the digits after the decimal point. See DECIMAL data type [Numeric] |
NUMERIC [( precision [,scale] )] |
Same as DECIMAL. See NUMERIC data type [Numeric] |
DOUBLE [PRECISION] |
A double-precision floating-point number. See DOUBLE data type [Numeric] |
FLOAT [( precision )] |
A floating point number, which may be single or double precision. See FLOAT data type [Numeric] |
[UNSIGNED] {INT|INTEGER} |
An integer requiring 4 bytes of storage. See INT or INTEGER data type [Numeric] |
REAL |
A single-precision floating-point number stored in 4 bytes. See REAL data type [Numeric] |
[UNSIGNED] SMALLINT |
An integer requiring 2 bytes of storage. See SMALLINT data type [Numeric] |
[UNSIGNED] TINYINT |
An integer requiring 1 byte of storage. See TINYINT data type [Numeric] |
DATE |
A calendar date, such as a year, month and day. See DATE data type [Date and Time] |
TIME |
The time of day, containing hour, minute, second and fraction of a second. See TIME data type [Date and Time] |
DATETIME |
Identical to TIMESTAMP. See DATETIME data type [Date and Time] |
TIMESTAMP |
The point in time, containing year, month, day, hour, minute, second and fraction of a second. See TIMESTAMP data type [Date and Time] |
BINARY [( max-length )] |
Binary data of maximum length max-length bytes. The maximum length is 2048 bytes. See BINARY data type [Binary] |
VARBINARY [( max-length )] |
Identical to BINARY. See VARBINARY data type [BINARY] |
LONG VARCHAR |
Arbitrary length character data. Conditions in SQL statements (such as in the WHERE clause) cannot operate on LONG VARCHAR columns. The only operations allowed on LONG VARCHAR columns are to insert, update, or delete them, or to include them in the select-list of a query.
The maximum size of LONG VARCHAR values is 64 kb. See LONG BINARY data type [BINARY] |
LONG BINARY |
Arbitrary length binary data. Conditions in SQL statements (such as in the WHERE clause) cannot operate on LONG VARCHAR columns. The only operations allowed on LONG VARCHAR columns are to insert, update, or delete them, or to include them in the select-list of a query.
The maximum size of LONG BINARY values is 64 kb. See LONG BINARY data type [BINARY] |