SQL/MX Comparison Guide for SQL/MP Users
DML Features
HP NonStop SQL/MX Comparison Guide for SQL/MP Users—523735-003
3-10
Interval Value Expressions
Interval Value Expressions
NonStop SQL/MP allows an interval to be divided by an interval. For example,
INTERVAL '6' DAY / INTERVAL '2' DAY results in an integer value of 3. NonStop
SQL/MP does not support the CAST function for date-time and interval data types.
NonStop SQL/MX (and SQL:1999) supports the division (or multiplication) of an
INTERVAL by a factor. For example, INTERVAL '6' DAY / 2 results in an interval of 3
days. If you want the result to be an integer and not an interval, convert or cast the
result as an integer.
Mathematical Functions
NonStop SQL/MP does not support mathematical functions. NonStop SQL/MX
supports many mathematical functions as extensions to the SQL-92 standard.
Sequence Functions
NonStop SQL/MP does not support sequence functions. In NonStop SQL/MX,
sequence functions operate on ordered rows of a SELECT result table that includes a
SEQUENCE BY clause.
Table 3-3. Mapping NonStop SQL/MP Datetime Functions To NonStop SQL/MX
NonStop SQL/MP NonStop SQL/MX
CURRENT CURRENT_TIMESTAMP
CURRENT YEAR TO DAY CURRENT_DATE
CURRENT YEAR TO SECOND CURRENT_TIMESTAMP(0)
CURRENT YEAR TO FRACTION(n) CURRENT_TIMESTAMP(n)
CURRENT HOUR TO SECOND CURRENT_TIME(0)
CURRENT HOUR TO FRACTION(n) CURRENT_TIME(n)
CURRENT YEAR CAST (CURRENT_DATE AS DATETIME YEAR)
CURRENT YEAR TO MONTH CAST (CURRENT_DATE AS DATETIME YEAR
TO MONTH)
CURRENT HOUR TO MINUTE CAST (CURRENT_TIME AS DATETIME HOUR
TO MINUTE)