Comparable And Compatible Data Types; Character Data Types; Datetime Data Types - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Type
Interval
scale is the number of digits to the right of the decimal.
(1) The size of a column that allows null values is 2 bytes larger than the size for the defined data type.
(2) The maximum row size is 4036 bytes, but the actual row size is less than that because of bytes used by null
indicators, varchar column length indicators, and actual data encoding.
(3) Storage size is the same as that required by CHAR data type but store only half as many characters depending
on character set selection.
(4) Storage size is reduced by 8 bytes for storage of the varying character length.
(5) Storage size is reduced by 8 bytes for storage of the varying character length.
(6) The maximum number of digits in an INTERVAL value is 18, including the digits in all INTERVAL fields of the
value. Any INTERVAL field that is a starting field can have up to 18 digits minus the number of other digits in the
INTERVAL value.

Comparable and Compatible Data Types

Two data types are comparable if a value of one data type can be compared to a value of the
other data type.
Two data types are compatible if a value of one data type can be assigned to a column of the
other data type, and if columns of the two data types can be combined using arithmetic operations.
Compatible data types are also comparable.
Assignment and comparison are the basic operations of Neoview SQL. Assignment operations
are performed during the execution of INSERT and UPDATE statements. Comparison operations
are performed during the execution of statements that include predicates, aggregate (or set)
functions, and GROUP BY, HAVING, and ORDER BY clauses.
The basic rule for both assignment and comparison is that the operands have compatible data
types. For assignment operations, a further restriction is that null cannot be assigned to a column
that has been defined as NOT NULL. Data types with different character sets cannot be compared.

Character Data Types

Values of fixed and variable length character data types of the same character set are all character
strings and are all mutually comparable and mutually assignable.
When two strings are compared, the comparison is made with a temporary copy of the shorter
string that has been padded on the right with blanks to have the same length as the longer string.

Datetime Data Types

Values of type datetime are mutually comparable and mutually assignable only if the types have
the same datetime fields. A DATE, TIME, or TIMESTAMP value can be compared with another
value only if the other value has the same data type.
All comparisons are chronological. For example, this predicate is true:
SQL Designation
INTERVAL
Description
Duration of time; value is in
the YEAR/MONTH range or
the DAY/HOUR/MINUTE/
SECOND/FRACTION range
Size or Range (1)
YEAR no constraint(6)
MONTH 0-11
DAY no constraint
HOUR 0-23
MINUTE 0-59
SECOND 0-59
FRACTION(n) 0-999999
in which n is the number of
significant digits (default is 6;
minimum is 1; maximum is 6);
stored in 2, 4, or 8 bytes depending
on number of digits
Data Types
199

Advertisement

Table of Contents
loading

Table of Contents