Interval Data Types; Numeric Data Types; Character String Data Types - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

TIMESTAMP '1997-09-28 00:00:00' >
TIMESTAMP '1997-06-26 00:00:00'

Interval Data Types

Values of type INTERVAL are mutually comparable and mutually assignable only if the types
are either both year-month intervals or both day-time intervals.
For example, this predicate is true:
INTERVAL '02-01' YEAR TO MONTH > INTERVAL '00-01' YEAR TO MONTH
The field components of the INTERVAL do not have to be the same. For example, this predicate
is also true:
INTERVAL '02-01' YEAR TO MONTH > INTERVAL '01' YEAR

Numeric Data Types

Values of the approximate data types FLOAT, REAL, and DOUBLE PRECISION, and values of
the exact data types NUMERIC, DECIMAL, INTEGER, SMALLINT, and LARGEINT, are all
numbers and are all mutually comparable and mutually assignable.
When an approximate data type value is assigned to a column with exact data type, rounding
might occur, and the fractional part might be truncated. When an exact data type value is assigned
to a column with approximate data type, the result might not be identical to the original number.
When two numbers are compared, the comparison is made with a temporary copy of one of the
numbers, according to defined rules of conversion. For example, if one number is INTEGER and
the other is DECIMAL, the comparison is made with a temporary copy of the integer converted
to a decimal.

Character String Data Types

"Considerations for Character String Data Types"
Neoview SQL includes both fixed-length character data and variable-length character data. You
cannot compare character data to numeric, datetime, or interval data.
character-type is:
CHAR[ACTER] [(length [CHARACTERS])] [char-set]
| PIC[TURE] X[(length)] [CHARACTERS] [char-set] [DISPLAY]
| CHAR[ACTER] VARYING(length) [CHARACTERS][char-set]
| VARCHAR(length) [CHARACTERS] [char-set]
| NCHAR [(length)] [CHARACTERS]
| NCHAR VARYING (length) [CHARACTERS]
| NATIONAL CHAR[ACTER] [(length)] [CHARACTERS]
| NATIONAL CHAR[ACTER] VARYING (length) [CHARACTERS]
char-set is
CHARACTER SET char-set-name
CHAR, PIC, NCHAR, and NATIONAL CHAR are fixed-length character types. CHAR VARYING,
VARCHAR, NCHAR VARYING and NATIONAL CHAR VARYING are varying-length character
types.
length
is a positive integer that specifies the number of characters allowed in the column. You must
specify a value for length.
char-set-name
is the character set name, which can be ISO88591 or UCS2 for any use.
CHAR[ACTER] [(length [CHARACTERS])] [char-set] [collate-clause] [UPSHIFT]
specifies a column with fixed-length character data.
200
SQL Language Elements

Advertisement

Table of Contents
loading

Table of Contents