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.

Important: You can display columns only of type CHAR, VARCHAR, INCR, INTEGER, and TIME in the event list. Do not add columns of any other type to the alerts.status table. If you add any columns that are not of type CHAR, VARCHAR, INCR, INTEGER, or TIME, probes cannot write to the alerts.status table. As a result, the probes fail to start.
Note: There are no maximum field sizes for CHAR or VARCHAR fields. However, there is a maximum row size of 64KB (65536 bytes). This row size is the total number of bytes used to store the data for each column plus a few bytes per column overhead.

The data types supported by the ObjectServer are listed in the following table.

Table 1. ObjectServer data types
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