Add Column -- Fields and controls

Built-in Type page



Built-in Type page

Data type
Length
Constant value
Data type

Use this box to specify the data type of the column. The data type can be one of:

INTEGER
For a large integer.
SMALLINT
For a small integer.
DECIMAL
For a decimal number.
REAL
For a single-precision floating-point number.
DOUBLE
For a double-precision floating-point number.
CHAR
For a fixed-length character string.
VARCHAR
For a varying-length character string.
LONG VARCHAR
For a varying-length character string whose maximum length is determined by the amount of space available in a page.
GRAPHIC
For a fixed-length graphic string.
VARGRAPHIC
For a varying-length graphic string.
LONG VARGRAPHIC
For a varying-length graphic string whose maximum length is determined by the amount of space available in a page.
DATE
For a date.
TIME
For a time.
TIMESTAMP
For a timestamp.

Length

Use this field to specify the length (byte count) of the columns based on the specified data type:

CHAR
Length of the fixed-length character string, which can range from 1 to 254. The default is 1.
VARCHAR
Maximum length of the varying-length character string, which can range from 1 to the maximum record size minus 8 bytes.

The maximum record size depends on the page size of the table space (the size of its buffer) and whether an edit procedure is specified for the table. The maximum record size is:

Therefore, the maximum VARCHAR length that you can specify is:

GRAPHIC
Length of the fixed-length graphic string, which can range from 1 to 127. The default is 1.
VARGRAPHIC
Maximum length of the varying-length graphic string, which can range from 1 to N/2, where N is the maximum row size minus 2 bytes.

Constant value

Use this field to specify the constant value to be assigned to the column in the absence of a value specified on an insert or load operation. The value that you specify must be a valid value for the column's data type. If you do not specify a value in this field, a default value is assigned depending on the data type of the column, as follows: