NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-5
Data Types
{ SMALLINT | INT[EGER] | LARGEINT } [SIGNED | UNSIGNED]
defines a binary integer column, as follows:
The default is SIGNED.
{ FLOAT [ ( precision ) ] | REAL | DOUBLE PRECISION }
specifies a column that stores floating point values:
Values stored as floating point numbers are approximate. SQL stores the values in
scientific notation with a mantissa and an exponent, which decreases the precision
of the stored value. Floating point data types should be used for values that are very
large or very small and cannot easily be stored as one of the other numeric data
types. If you can represent column values with one of the exact numeric data types
(such as INTEGER or NUMERIC), choose the exact data type over the approximate
data type.
DEC[IMAL] ( digits[,scale] ) [ SIGNED | UNSIGNED ]
specifies a column that stores decimal numeric values as ASCII characters.
digits and scale are positive integers that specify the precision in the number
of digits and the number of digits to the right of the decimal point, respectively.
digits cannot exceed 18.
SIGNED or UNSIGNED indicates whether the column values are signed or
unsigned. The sign is stored as the first bit of the leftmost byte. If digits is 10 or
more, the values must be signed.
The default is DECIMAL (1,0) SIGNED.
SMALLINT Two bytes, SIGNED or UNSIGNED; stores integers in the range
unsigned 0 to 65535 or signed -32768 to +32767.
INTEGER Four bytes, SIGNED or UNSIGNED; stores integers in the range
unsigned 0 to 4294967295 or signed -2147483648 to 2147483647.
LARGEINT Eight bytes, must be SIGNED; stores integers in the range -2**63 to
2**63 -1 (approximately 9.223 times 10 to the eighteenth power).
FLOAT Stores floating point numbers in the range +/-8.62* 10**-78 to +/-
1.16* 10**77. Uses 22 or 54 bits depending on precision.
precision is an integer in the range 1 to 54. The default is 54.
REAL Equivalent to FLOAT(22); stores floating point values with
approximately seven decimal digits of precision.
DOUBLE
PRECISION
Equivalent to FLOAT(54); stores floating point values with
approximately 16 decimal digits of precision.