SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual523725-004
6-33
Numeric Data Types
-------------
######
######
...
NonStop SQL/MX returns a warning indicating that you selected an unsupported data
type with undefined contents.
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 data types are types that can represent a value exactly: NUMERIC,
SMALLINT, INTEGER, LARGEINT, DECIMAL, and PICTURE COMMENT:.
Approximate numeric data types are types that do not necessarily represent a value
exactly: FLOAT, REAL, and DOUBLE PRECISION.
A column in an SQL/MP table declared with a floating-point data type is stored in
Tandem floating-point format and all computations on it are done assuming that.
SQL/MP tables can contain only Tandem floating-point data. For information about
SQL/MP data types, see the SQL/MP Reference Manual.
A column in an SQL/MX table declared with a floating-point data type is stored in IEEE
floating-point format and all computations on it are done assuming that. SQL/MX tables
can contain only IEEE floating-point data. NonStop SQL/MX can select data from both
SQL/MP and SQL/MX tables. For information, see default attribute Data Types on
page 10-39.
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 18.
If precision is 10 or more, the value must be SIGNED. scale specifies the
number of digits to the right of the decimal point.
The default is NUMERIC (9,0) SIGNED.
exact-numeric-type is:
NUMERIC [(precision [,scale])] [SIGNED|UNSIGNED]
| SMALLINT [SIGNED|UNSIGNED]
| INT[EGER] [SIGNED|UNSIGNED]
| LARGEINT
| DEC[IMAL] [(precision [,scale])] [SIGNED|UNSIGNED]
| PIC[TURE] [S]{9(integer) [V[9(scale)]] | V9(scale)}
[DISPLAY [SIGN IS LEADING] | COMP]
approximate-numeric-type is:
FLOAT [(precision)]
| REAL
| DOUBLE PRECISION