Neoview SQL Reference Manual (R2.4 SP2)

Numeric Data Types
Numeric data types are either exact or approximate. A numeric data type is compatible with any
other numeric data type, but not with character, datetime, or interval data types.
exact-numeric-type is:
NUMERIC [(precision [,scale])] [SIGNED|UNSIGNED]
| SMALLINT [SIGNED|UNSIGNED]
| INT[EGER] [SIGNED|UNSIGNED]
| LARGEINT
| DEC[IMAL] [(precision [,scale])] [SIGNED|UNSIGNED]
approximate-numeric-type is:
FLOAT [(precision)]
| REAL
| DOUBLE PRECISION
Exact numeric data types are types that can represent a value exactly: NUMERIC, SMALLINT,
INTEGER, LARGEINT, and DECIMAL.
Approximate numeric data types are types that do not necessarily represent a value exactly:
FLOAT, REAL, and DOUBLE PRECISION.
A column in a Neoview SQL table declared with a floating-point data type is stored in IEEE
floating-point format and all computations on it are done assuming that. Neoview SQL tables
can contain only IEEE floating-point data.
NUMERIC [(precision [,scale])] [SIGNED|UNSIGNED]
specifies an exact numeric column—a two-byte binary number, SIGNED or UNSIGNED.
precision specifies the total number of digits and cannot exceed 128. If precision is
between 10 and 18, you must use a signed value to obtain the supported hardware data type.
If precision is over 18, you will receive the supported software data type. You will also receive
the supported software data type if the precision type is between 10 and 18, and you specify
UNSIGNED. scale specifies the number of digits to the right of the decimal point.
The default is NUMERIC (9,0) SIGNED.
SMALLINT [SIGNED|UNSIGNED]
specifies an exact numeric column—a two-byte binary integer, SIGNED or UNSIGNED. The
column stores integers in the range unsigned 0 to 65535 or signed -32768 to +32767.
The default is SIGNED.
INT[EGER] [SIGNED|UNSIGNED]
specifies an exact numeric column—a 4-byte binary integer, SIGNED or UNSIGNED. The
column stores integers in the range unsigned 0 to 4294967295 or signed -2147483648 to
+2147483647.
The default is SIGNED.
LARGEINT
specifies an exact numeric column—an 8-byte signed binary integer. The column stores
integers in the range -2**63 to +2**63 -1 (approximately 9.223 times 10 to the eighteenth
power).
DEC[IMAL] [(precision [,scale])] [SIGNED|UNSIGNED]
specifies an exact numeric column—a decimal number, SIGNED or UNSIGNED,stored as
ASCII characters. precision specifies the total number of digits and cannot exceed 18. If
precision is 10 or more, the value must be SIGNED. The sign is stored as the first bit of the
leftmost byte. scale specifies the number of digits to the right of the decimal point.
The default is DECIMAL (9,0) SIGNED.
Data Types 241