SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-23
Datetime Data Types
You can also insert into or update NCHAR columns in SQL/MP tables. See Inserting
Into or Updating SQL/MP NCHAR Columns on page 6-62.
Datetime Data Types
Considerations for Datetime Data Types
SQL/MP Considerations for Datetime Data Types Not Equivalent to DATE, TIME,
TIMESTAMP
SQL/MP Considerations for Datetime Data Types Equivalent to DATE, TIME,
TIMESTAMP
A value of datetime data type represents a point in time according to the Gregorian
calendar and a 24-hour clock in local civil time (LCT). A datetime item can represent a
date, a time, or a date and time.
NonStop SQL/MX accepts dates, such as October 5 to 14, 1582, that were omitted
from the Gregorian calendar. This functionality is an SQL/MX extension.
The range of times that a datetime value can represent is:
January 1, 1 A.D., 00:00:00.000000 (low value)
December 31, 9999, 23:59:59.999999 (high value)
NonStop SQL/MX has three datetime data types:
DATE
specifies a datetime column that contains a date in the external form yyyy-mm-dd
and stored in four bytes.
TIME [(time-precision)]
specifies a datetime column that, without the optional time-precision, contains
a time in the external form hh:mm:ss and is stored in three bytes. time-
precision is an unsigned integer that specifies the number of digits in the
fractional seconds and is stored in four bytes. The default for time-precision is
0, and the maximum is 6.
TIMESTAMP [(timestamp-precision)]
specifies a datetime column that, without the optional timestamp-precision,
contains a timestamp in the external form yyyy-mm-dd hh:mm:ss and is stored in
seven bytes. timestamp-precision is an unsigned integer that specifies the
number of digits in the fractional seconds and is stored in four bytes. The default
for timestamp-precision is 6, and the maximum is 6.
datetime-type is:
DATE
| TIME [(time-precision)]
| TIMESTAMP [(timestamp-precision)]