SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual523725-004
6-74
Numeric 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).
exact-numeric-literal
is an exact numeric value that includes an optional plus sign (+) or minus sign (-),
up to 18 digits (0 through 9), and an optional period (.) that indicates a decimal
point. Leading zeros do not count toward the 18-digit limit; trailing zeros do.
A numeric literal without a sign is a positive number. An exact numeric literal that
does not include a decimal point is an integer. Every exact numeric literal has the
data type NUMERIC and the minimum precision required to represent its value.
approximate-numeric-literal
is an exact numeric literal followed by an exponent expressed as an uppercase E
or lowercase e followed by an optionally signed integer.
Numeric values expressed in scientific notation are treated as data type REAL if
they include no more than seven digits before the exponent, but treated as type
DOUBLE PRECISION if they include eight or more digits. Because of this factor,
trailing zeros after a decimal can sometimes increase the precision of a numeric
literal used as a DOUBLE PRECISION value.
For example, if XYZ is a table that consists of one DOUBLE PRECISION column,
the inserted value:
INSERT INTO XYZ VALUES (1.00000000E-10)
has more precision than:
INSERT INTO XYZ VALUES (1.0E-10)
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...