Data Definition Language (DDL) Reference Manual (G06.24+)
Definition Attributes
Data Definition Language (DDL) Reference Manual—426798-002
6-54
TYPE Clause
°
SQL INTERVAL data type:
•
The syntax for the SQL INTERVAL data type differs from the corresponding
SQL syntax. For DDL, you do not use parentheses around the start-
field-precision and end-field-precision items; for SQL you do
enclose start-field-precision and end-field-precision in
parentheses.
•
An SQL INTERVAL field can contain a maximum of 18 digits, ignoring such
other characters as colons (:), hyphens (-), and periods (.). For example,
“5:2:15:36.8” is a valid interval value.
•
If you specify start-date-time TO end-date-time for an SQL
INTERVAL field, use the following guidelines for valid values. Note that
YEAR and DAY can appear only in a start-date-time item.
•
If you specify a VALUE clause for an SQL INTERVAL field, its value must
be SYSTEM, CURRENT, or interval-literal. You cannot specify
VALUE ZERO or VALUE ZEROES for an SQL INTERVAL field. See
VALUE Clause on page 6-79 for additional information about these values.
•
BIT data type:
°
A bit field inside a group structure that follows a nonbit field starts on a new 16-
bit word. If you specify bit fields consecutively inside the group structure, DDL
allocates the same 16-bit word for all contiguous bit fields that can fit in one 16-
bit word. For the next bit field that cannot fit in the same 16-bit word, DDL
allocates the next word.
Consecutive bit fields that occupy the same word have the same byte offset
but different bit offset values in their records in the DICTOBL dictionary file.
A field that follows a bit field and has another data type starts on the next word.
A substructure containing only bit fields always starts and ends on a word
boundary, padded with implicit bit fillers when necessary. Such a substructure
is always an even number of bytes long, which is consistent with the way the
C, Pascal, and TAL compilers allocate spaces for structures containing bit
maps.
YEAR Range is limited by start-field-precision
MONTH 0 to 11
DAY Range is limited by start-field-precision
HOUR 0 to 23
MINUTE 0 to 59
SECOND 0 to 59
FRACTION 0 to 999999