SQL/MX Comparison Guide for SQL/MP Users

DML Features
HP NonStop SQL/MX Comparison Guide for SQL/MP Users523735-003
3-6
Date-time Literals
Date-time Literals
In NonStop SQL/MP, a date-time literal is a DATETIME, DATE, TIME, or TIMESTAMP
literal that you can use in an expression and which can appear in default, USA, or
European format.
In NonStop SQL/MX, a date-time literal is a DATE, TIME, or TIMESTAMP literal. An
SQL/MX date-time literal begins with the DATE, TIME, or TIMESTAMP keyword and
can appear in default, USA, or European format.
For example, these DATE literals are in default, USA, and European formats,
respectively:
DATE '1990-01-22'
DATE '01/22/1990'
DATE '22.01.1990'
Supported and Unsupported SQL/MP Date-Time Literals in
NonStop SQL/MX
NonStop SQL/MP date-time literals fall into one of these categories:
Those that map directly to SQL:1999 types and are supported by NonStop
SQL/MX
Those that do not map to SQL:1999 types but are supported by NonStop SQL/MX
Those that do not map to SQL:1999 types and are not supported in NonStop
SQL/MX
NonStop SQL/MP date-time literals that are not supported are listed in Table 3-1:
:
Table 3-1. Support For NonStop SQL/MP DATETIME Literals in NonStop
SQL/MX (page 1 of 3)
NonStop SQL/MP DATETIME Type
Supported
in NonStop
SQL/MX Maps To ANSI Type
DATETIME YEAR TO DAY Yes DATE
DATETIME YEAR TO SECOND Yes TIMESTAMP(0)
DATETIME YEAR TO FRACTION (1) Yes TIMESTAMP(1)
DATETIME YEAR TO FRACTION (2) Yes TIMESTAMP(2)
DATETIME YEAR TO FRACTION (3) Yes TIMESTAMP(3)
DATETIME YEAR TO FRACTION (4) Yes TIMESTAMP(4)
DATETIME YEAR TO FRACTION (5) Yes TIMESTAMP(5)
DATETIME YEAR TO FRACTION (6) Yes TIMESTAMP(6)
DATETIME HOUR TO SECOND Yes TIME(0)
DATETIME HOUR TO FRACTION (1) Yes TIME(1)
DATETIME HOUR TO FRACTION (2) Yes TIME(2)