SQL/MX 3.2 Management Manual (H06.25+, J06.14+)

Table Of Contents
Defining Numeric Data
Numeric data types are either exact or approximate. Exact numeric data types can represent a
value exactly. Approximate numeric data types do not. NonStop SQL/MX supports these exact
and approximate numeric data types:
Exact numeric data typesNUMERIC
SMALL INT
INTEGER
LARGEINT
DECIMAL
PICTURE
Approximate numeric data typesFLOAT
REAL
DOUBLE PRECISION
FLOAT is compatible with other numeric data types. NonStop SQL/MX performs implicit data
conversion from other numeric types to handle arithmetic or comparison operations when required.
A column of an exact numeric type can accept a floating-point number. Also, a column of the
FLOAT data type can accept either a floating-point number or an exact numeric type. These rules
apply both to columns of an SQL/MX object and to a host variable field.
SQL/MX tables require IEEE floating-point data. SQL/MP tables require Tandem floating-point
data. For more information, see the SQL/MX Reference Manual.
When NonStop SQL/MX performs arithmetic operations on operands that have mixed data types,
the data type allowing the largest value is used to evaluate the numbers. For instance, if a REAL
number is used and REAL is the data type that allows the largest value, all other numeric data types
are converted first to REAL and then used in the expression.
Defining Datetime and Time Interval Data
The data types for datetime data are:
Contains a date in the external form yyyy-mm-dd.DATE
Contains a time in the external form hh:mm:ss.TIME
Contains a timestamp in the external form yyyy-mm-dd hh:mm:ss[.ffffff]. The
optional fractional seconds portion can be from zero to six digits long.
TIMESTAMP
The data type for time interval data is:
Duration of timeINTERVAL
Columns of the DATE, TIME, TIMESTAMP, and INTERVAL data types contain information about
dates, times, and time intervals. A comparison of these data types follows, denoting in each case
the data type, its meaning, and the range of data allowed in fields of a value of this type. The
fields in these data types are not equivalent to columns.
A column value of type DATE is made up of these contiguous fields:
0001 to 9999YearYEAR
01 to 12Month of yearMONTH
01 to 31Day of MonthDAY
The maximum value of DAY depends on the length of the month.
90 Creating an SQL/MX Database