NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
I-24
Examples—Interval Literals
minutes
is an unsigned integer that specifies a number of minutes. Used as a starting field, it
can have up to 18 digits, minus the number of digits in the other fields of the
INTERVAL literal; as a nonstarting field, it must be in the range 0 through 59.
Negative values are allowed, with the minus sign inside the quotes.
seconds
is an unsigned integer that specifies a number of seconds. Used as a starting field, it
can have up to 18 digits, minus the number of digits in the other fields of the
INTERVAL literal; as a nonstarting field, it must be in the range 0 through 59.
Negative values are allowed, with the minus sign inside the quotes.
fraction
is an unsigned integer that specifies a fraction of a second. Used as a starting field, it
can have up to 18 digits; as an ending field, it is limited to the number of digits
specified by precision.
start-field [ (digits) ] [ TO end-field]
specifies the range of INTERVAL fields in the literal and the number of digits
allowed in the starting field. The default for digits is 2. (See INTERVAL Data
Type on page I-19 if you need more information about INTERVAL fields.)
precision
is an unsigned integer in the range 1 to 6 that specifies the number of significant
digits in the portion of the literal that specifies the fraction of a second. The default
is 6.
Examples—Interval Literals
The following are all INTERVAL literals:
INVOKE Directive and Command
INVOKE is a directive or SQLCI utility command that produces a record description
that corresponds to a row in a specified table or view.
INTERVAL “1” MONTH An interval of 1 month
INTERVAL “7” DAY An interval of 7 days
INTERVAL “2-7
YEAR TO MONTH
An interval of 2 years, 7 months
INTERVAL
“5:2:15:36.8”
DAY TO FRACTION(1)
An interval of 5 days, 2 hours, 15 minutes, and 36.8
seconds
- INTERVAL “5” DAY An interval that subtracts 5 days