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

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-33
Numeric Data Types
PIC[TURE] [S]{ 9(integer) [V[9(scale)]] | V9(scale) }
[DISPLAY [SIGN IS LEADING] | COMP]
specifies an exact numeric column. If you specify COMP, the column is binary and
equivalent to the data type NUMERIC. If you omit COMP, DISPLAY [SIGN IS
LEADING] is the default, and the data type is equivalent to the data type DECIMAL.
The S specifies a signed column. The sign is stored as the first bit of the leftmost
byte (digit). If you omit S, the column is unsigned. A column with ten or more digits
must be signed.
The 9(integer) specifies the number of digits in the integral part of the value.
The V designates a decimal position. The 9(scale) designates the number of
positions to the right of the decimal point. If you omit V9 (scale), the scale is 0. If
you specify only V9, the scale is 1.
Instead of integer or scale, you can specify multiple 9s, with each 9
representing one digit. For example, PIC 9V999 has a scale of 3. The values of
integer and scale determine the length of the column. The sum of these values
cannot exceed 18.
There is no default. You must specify either 9(integer) or V9 (scale).
FLOAT [( precision )]
specifies an approximate numeric column. The column stores floating-point
numbers and designates from 1 through 52 bits of precision. The range is from
+/- 2.2250738585072014e-308 through +/-1.7976931348623157e+308 stored in 8
bytes.
An IEEE FLOAT precision data type is stored as an IEEE DOUBLE, that is, in 8
bytes, with the specified precision.
The default precision is 52.
REAL
specifies a 4-byte approximate numeric column. The column stores 32-bit
floating-point numbers with 23 bits of binary precision and 8 bits of exponent.
The minimum and maximum range is from +/- 1.17549435e-38 through
+/ 3.40282347e+38.
DOUBLE PRECISION
specifies an 8-byte approximate numeric column.
The column stores 64-bit floating-point numbers and designates from 1 through 52
bits of precision.
An IEEE DOUBLE PRECISION data type is stored in 8 bytes with 52 bits of binary
precision and 11 bits of exponent. The minimum and maximum range is from +/-
2.2250738585072014e-308 through +/-1.7976931348623157e+308.