NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-7
DATE Data Type
INTERVAL start-field [ (sf-prec) ] [ TO end-field ]
specifies a column that represents a duration of time as a year-month or day-time
interval. start-field and end-field specify the starting or ending field in
one of these ranges of interval fields:
YEAR, MONTH
DAY, HOUR, MINUTE, SECOND, FRACTION(fraction-prec)
If the ending field is FRACTION, you can specify a precision of from 1 to 18 digits,
within parentheses; the default is FRACTION(6).
sf-prec is an unsigned integer greater than 0 that specifies the number of
significant digits allowed for the first field of INTERVAL values.
DEFAULT default-type | NO DEFAULT
specifies a default value for the column or specifies that the column has no default
value. default-type must be a literal compatible with the data type of the
column or one of the keywords CURRENT, SYSTEM, or NULL. See DEFAULT
Clause on page D-24 for more information.
The default is DEFAULT NULL.
NOT NULL
specifies that the column cannot contain any null values. See Null Values on
page N-6 for more information.
You cannot specify NOT NULL if you also specify DEFAULT NULL, either
explicitly or by default.
DATE Data Type
An item with data type DATE represents a date according to the Gregorian calendar.
Values of data type DATE are equivalent to values of data type DATETIME declared as:
DATETIME YEAR TO DAY.
See DATETIME Data Type on page D-14 if you need additional information.
Examples—DATE Data Type
The following are literals of data type DATE in (respectively) default, USA, and
European format:
DATE "1990-01-22"
DATE "01/22/1990"
DATE "22.01.1990"
See DATE-TIME Literals on page D-9 for additional information.