SQL/MX Comparison Guide for SQL/MP Users
DML Features
HP NonStop SQL/MX Comparison Guide for SQL/MP Users—523735-003
3-9
Numeric Value Expressions and Functions
Except for the functions listed previously, NonStop SQL/MX offers all the functions of
NonStop SQL/MP and adds many new functions.
Numeric Value Expressions and Functions
Both NonStop SQL/MX and NonStop SQL/MP offer an extension to SQL:1999, the
exponentiation operator (**), but in results of computations of numeric expressions,
NonStop SQL/MX might differ in precision and scale from the computations within
NonStop SQL/MP.
Datetime Functions
In NonStop SQL/MP, the CURRENT function returns a current local DATETIME value,
based on the specified start-end fields, such as CURRENT YEAR TO MONTH,
CURRENT YEAR or CURRENT SECOND. CURRENT by itself is the equivalent of
CURRENT YEAR TO FRACTION.
For the same results in NonStop SQL/MX, use the CURRENT_DATE,
CURRENT_TIME, or CURRENT_TIMESTAMP function. In addition, CURRENT is an
SQL/MX extension that maps to CURRENT_TIMESTAMP, equivalent to its result in
NonStop SQL/MP. NonStop SQL/MX does not support the use of CURRENT with start-
end fields. For this result, you should cast the appropriate form of SQL/MX
CURRENT_DATE, CURRENT_TIME, or CURRENT_TIMESTAMP to the SQL/MP
DATETIME type with the desired start-end fields. Table 3-3 compares SQL/MP and
SQL/MX date-time functions:
Table 3-2. NonStop SQL/MP and NonStop SQL/MX Functions
NonStop SQL/MP
Function
Implemented
in NonStop
SQL/MX? Comments
COMPUTE_TIMESTAMP No
CURRENT Changed In NonStop SQL/MX, supported to return a
range of date-time values only in NonStop
SQL/MP stored text. Otherwise, in NonStop
SQL/MX, same as CURRENT_TIMESTAMP.
See mapping under Datetime Functions
.
EXTEND Changed In NonStop SQL/MX, supported only for use
in NonStop SQL/MP stored text. Otherwise,
use the CAST specification in NonStop
SQL/MX.
SETSCALE Changed In NonStop SQL/MX, you provide the scale
when you declare your host variables in your
program. See SETSCALE Function
.