SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-71
Numeric Literals
Note that in both NonStop SQL/MX and NonStop SQL/MP, the default leading precision
for seconds is 2, and the default trailing precision for fraction of a second is 6.
Examples of Interval Literals
Numeric Literals
A numeric literal represents a numeric value. Numeric literals can be represented as
an exact numeric literal (without an exponent) or as an approximate numeric literal by
using scientific notation (with an exponent).
FRACTION FRACTION None
FRACTION(x) FRACTION None
FRACTION(x) FRACTION(y) None
FRACTION FRACTION(y) None
INTERVAL '1' MONTH Interval of 1 month
INTERVAL '7' DAY Interval of 7 days
INTERVAL '2-7' YEAR TO MONTH Interval of 2 years, 7 months
INTERVAL '5:2:15:36.33' DAY
TO SECOND(2)
Interval of 5 days, 2 hours, 15 minutes, and
36.33 seconds
INTERVAL - '5' DAY Interval that subtracts 5 days
INTERVAL '100' DAY(3) Interval of 100 days. This example requires
an explicit leading precision of 3 because
the default is 2.
INTERVAL '364 23' DAY(3)
TO HOUR
Interval of 364 days, 23 hours. The
separator for the day and hour fields can
be a space or a colon.
exact-numeric-literal is:
[+|-]unsigned-integer[.[unsigned-integer]]
| [+|-].unsigned-integer
approximate-numeric-literal is:
mantissa{E|e}exponent
mantissa is:
exact-numeric-literal
exponent is:
[+|-]unsigned-integer
unsigned-integer is:
digit...
SQL/MP Start Field SQL/MP End Field Equivalent SQL/MX Type