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 255. 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:
- 4056, for a 4 KB page size and no edit procedure on the table.
- 32714, for a 32 KB page size and no edit procedure on the table.
- 4046, for a 4 KB page size and an edit procedure defined.
- 32704, for a 32 KB page size and an edit procedure defined.
Therefore, the maximum VARCHAR length that you can specify is:
- 4048, for a 4 KB page size and no edit procedure.
- 32706, for a 32 KB page size and no edit procedure.
- 4038, for a 4 KB page size and an edit procedure.
- 32696, for a 32 KB page size and an edit procedure.
- 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:
- For numeric data types (for example, INTEGER), the default value is 0.
- For fixed-length string data types, the default value is a string made of blanks.
- For varying-length strings, the default value is a string of length 0.
- For the DATE data type, the default value is the current date.
Exception: If you are altering a table,
the default value for existing rows is 1 January 0001.
- For the TIME data type, the default value is the current time.
Exception: If you are altering a table,
the default
value is 0 hours, 0 minutes, and 0 seconds.
- For the TIMESTAMP data type, the default value is the current timestamp.
Exception: If you are altering a table,
the default
value is a timestamp corresponding to a date of 1 January 0001 and a time
corresponding to 0 hours, 0 minutes, 0 seconds, and 0 microseconds.