Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 49
TYPE Clause
SQL VARCHAR length
represents an SQL VARCHAR variable-length character string;
length
is the
maximum number of characters allowed in the string.
length
must be an
unsigned integer greater than zero.
SQL DATETIME
represents an SQL DATETIME data type. An SQL DATETIME data type
specifies a point in time according to the Gregorian calendar. SQL DATETIME
can contain only date, time, or date and time values.
start-date-time
and
end-date-time
must each be one of the following:
YEAR
MONTH
DAY
HOUR
MINUTE
SECOND
FRACTION [ end-field-precision ]
These SQL DATETIME qualifiers have an implicit order: YEAR, MONTH, DAY,
HOUR, MINUTE, SECOND, and FRACTION. The
start-date-time
item
must appear earlier in this list than the
end-date-time
item. For example,
SQL DATETIME MONTH TO MINUTE is a valid SQL DATETIME specification,
but SQL DATETIME SECOND TO HOUR is not valid.
FRACTION specifies the maximum number of digits for a fraction of a second.
The valid range for
end-field-precision
is 1 through 6. The default value
is 6.
DATE
is a special representation of the SQL DATETIME data type, equivalent to SQL
DATETIME YEAR TO DAY.
SQL TIME
is a special representation of the SQL DATETIME data type, equivalent to SQL
DATETIME HOUR TO SECOND.
SQL TIMESTAMP
is a special representation of the SQL DATETIME data type, equivalent to SQL
DATETIME YEAR TO FRACTION 6.
SQL INTERVAL
represents an SQL INTERVAL data type. SQL INTERVAL designates a
duration of time in either year-month or day-time intervals.