Numeric Data Types - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Within the definition of an interval range (other than a single field), the start-field and
end-field can be any of the specified fields with these restrictions:
An interval range is either year-month or day-time—that is, if the start-field is YEAR,
the end-field is MONTH; if the start-field is DAY, HOUR, or MINUTE, the
end-field is also a time field.
The start-field must precede the end-field within the hierarchy: YEAR, MONTH,
DAY, HOUR, MINUTE, and SECOND.
Signed Intervals
To include a quoted string in a signed interval data type, the sign must be outside the quoted
string. It can be before the entire literal or immediately before the duration enclosed in quotes.
For example, for the interval "minus (5 years 5 months) these formats are valid:
INTERVAL - '05-05'YEAR TO MONTH
- INTERVAL '05-05' YEAR TO MONTH
Overflow Conditions
When you insert a fractional value into an INTERVAL data type field, if the fractional value is
0 (zero) it does not cause an overflow. Inserting value INTERVAL '1.000000' SECOND(6) into a
field SECOND(0) does not cause a loss of value. Provided that the value fits in the target column
without a loss of precision, Neoview SQL does not return an overflow error.
However, if the fractional value is > 0, an overflow occurs. Inserting value INTERVAL '1.000001'
SECOND(6) causes a loss of value.

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]
| PIC[TURE] [S]{9(integer) [V[9(scale)]] | V9(scale)}
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, 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 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 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.
[DISPLAY [SIGN IS LEADING] | COMP]
Numeric Data Types
205

Advertisement

Table of Contents
loading

Table of Contents