SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)
Creating an SQL/MX Database
HP NonStop SQL/MX Installation and Management Guide—523723-004
7-25
Managing Table Data
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:
The data type for time interval data is:
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:
The maximum value of DAY depends on the length of the month.
An item of type TIME indicates a time of day based on a 24-hour clock and is made up
of these contiguous fields:
A column value of type TIMESTAMP is made up of these fields:
DATE Contains a date in the external form yyyy-mm-dd.
TIME Contains a time in the external form hh:mm:ss.
TIMESTAMP 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.
INTERVAL Duration of time
YEAR Year 0001 to 9999
MONTH Month of year 01 to 12
DAY Day of Month 01 to 31
HOUR Hour of day 00 to 23
MINUTE Minute of hour 00 to 59
SECOND Second of minute 00 to 59
YEAR Year 0001 to 9999
MONTH Month of year 01 to 12
DAY Day of month 01 to 31
HOUR Hour of day 00 to 23