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

Introduction
HP NonStop SQL/MX Reference Manual540440-003
1-29
Selecting or Changing Data
through SECOND are directly compatible with their corresponding SQL/MX INTERVAL
data types.
If you attempt to select data from a FRACTION-only column, the value is returned as
the CHAR data type consisting of a string of '#' characters with the same display
length as the length of the column.
See Selecting INTERVAL Columns in SQL/MP Tables on page 6-30.
Inserting or Updating Any INTERVAL Column
NonStop SQL/MX supports inserting into or updating any columns with the INTERVAL
data type in SQL/MP tables except those consisting of FRACTION only. Use an
INTERVAL literal to insert into or update an INTERVAL column in the usual way. The
literal is specified:
[-]INTERVAL [-]{'year-month'|'day:time'} interval-qualifier
For the complete syntax of interval literals, see Interval Literals on page 6-67. See
Inserting Into or Updating Any SQL/MP INTERVAL Column on page 6-69.
NCHAR Data
From SQL/MX Release 2.x, you can select character data from NCHAR columns in
SQL/MP and SQL/MX tables. You can insert into or update NCHAR columns in an
SQL/MP table only when the character data being written to the table contains an even
number of bytes. A string literal you use this way can be specified:
N'string'
N associates the default character set with the string literal. The default character set is
the NATIONAL_CHARSET attribute you specify when you install NonStop SQL/MX.
For more information about setting the NCHAR default, see Character Sets on
page 6-3.
For SQL/MX Release 2.x, LIKE predicates and character string functions that refer to
double byte-encoded characters in NCHAR columns of SQL/MP and SQL/MX tables
always provide the correct results. Character string functions include INSERT, LEFT,
LOCATE, LPAD, LTRIM, POSITION, REPLACE, RIGHT, RPAD, RTRIM, SUBSTRING,
and TRIM.
Because SQL/MX Release 2.x compares and sorts all character data, including double
byte-encoded characters, on the character boundary instead of the byte boundary,
ORDER BY and GROUP BY also return the correct results. NonStop SQL/MX uses a
binary collation, so characters are always compared and sorted on the basis of their
character value, not their byte length. If the character values of compared characters
are the same, a match occurs.