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

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-72
Numeric Literals
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)
Examples of Numeric Literals
These are all numeric literals, along with their display format:
Literal Display Format in MXCI
477 477
580.45 580.45
+005 5
-.3175 -.3175
1300000000 1300000000
99. 99
-0.123456789012345678 -.123456789012345678
99E-2 9.9000000E-001
12.3e+5 1.2299999E+006