SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
N-11
Numeric Data Types
>> SELECT DEPT FROM PRJ;
DEPT
------
Z
Z
Z
Numeric Data Types
Table N-1 lists the numeric data types available in NonStop SQL/MP. A numeric data
type is compatible with any other numeric data type, but not with character, date-time,
or interval data types.
Table N-1. Numeric Data Types in SQL—Binary 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:
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