Specifying data types for columns
Each column value in the ObjectServer has an
associated data type. The data type determines how the ObjectServer
processes the data in the column. For example, the plus operator (+
)
adds integer values or concatenates string values, but does not act
on Boolean values.
When creating a table using the CREATE TABLE command, you must specify a data type for each column that you define.
The data types supported by the ObjectServer are listed in the following table.
SQL type | Description | Default value | ObjectServer ID for data type |
---|---|---|---|
INTEGER | 32-bit signed integer. | 0 | 0 |
INCR | 32-bit signed auto-incrementing integer. Applies to table columns only. Columns of this type are set by the system. You can change the auto increment to a different value by using the ALTER TABLE SET INCR command. You can use the command to set what values are assigned to new rows. You cannot change INCR columns in existing rows. |
1 | 5 |
UNSIGNED | 32-bit unsigned integer. | 0 | 12 |
BOOLEAN | TRUE or FALSE. | FALSE | 13 |
REAL | 64-bit signed floating point number. | 0.0 | 14 |
TIME | Time, stored as the number of seconds since midnight January 1, 1970. This is the Coordinated Universal Time (UTC) international time standard. | Thu Jan 1 01:00:00 1970 | 1 |
CHAR(integer) | Fixed size character string, integer characters
long. The char type is identical in operation to VARCHAR, but performance is better for mass updates that change the length of the string. |
'' | 10 |
VARCHAR(integer) | Variable size character string, up to integer characters
long. The VARCHAR type uses less storage space than the char type and the performance is better for deduplication, scanning, insert, and delete operations. |
'' | 2 |
INTEGER64 | 64-bit signed integer. | 0 | 16 |
UNSIGNED64 | 64-bit unsigned integer. | 0 | 17 |