NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
N-12
Numeric Data Types in SQL—Binary Types
Numeric Data Types in SQL—Binary Types
Numeric Data Types in SQL—Floating Point Types
Numeric Data Types in SQL—Decimal Types
SQL Designation Description Size or Range (1)
NUMERIC(1,s) to
NUMERIC(18,2)
Exact binary number with optional
scale; signed or unsigned for 1 to 9
digits; signed required for 10 or more
digits
1 to 18 digits stored as
follows:
1 to 4 digits in 2 bytes
5 to 9 digits in 4 bytes
10 to 18 digits in 8 bytes
PIC S9V9 COMP to PIC
S9(18) COMP
Binary number; same as NUMERIC 1 to 18 digits;
stored as NUMERIC
SMALLINT Binary integer; signed or unsigned –32768 to +32767
or 0
to 65535;
stored in 2 bytes
INTEGER Binary integer; signed or unsigned –2147483648 to
+2147483647
or 0 to 4294967295;
stored in 4 bytes
LARGEINT Binary integer; signed only –2**63 to 2**63-1;
stored in 8 bytes
SQL Designation Description Size or Range (1)
FLOAT [(pre)] Approximate floating point number;
pre-designates from 1 through 54
bits of precision
+/-8.62 times 10**-78
through +/-1.16 times
10**77;
stored as follows:
pre 1 to 22 in 4 bytes,
pre 23 to 54 in 8 bytes
REAL Approximate floating point number
(22 bits)
Approximately 7
decimal digits of
precision;
same range as FLOAT;
stored in 4 bytes
DOUBLE PRECISION Approximate floating point number
(54 bits)
Approximately 16
decimal digits of
precision;
same range as FLOAT;
stored in 8 bytes
SQL Designation Description Size or Range (1)
DECIMAL (1,s) to
DECIMAL (18,s) and
PIC S9V9 DISPLAY to
PIC S9(18) DISPLAY
Decimal number with optional scale;
stored in ASCII; must be signed if 10
or more digits, otherwise can be
signed or unsigned.
1 to 18 digits; byte
length equals the
number of digits