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

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-62
Character String Literals
When specifying string literals:
Do not put a space between the character set qualifier (for example, _KANJI) and
the character string literal (for example, 'abcd'). If you use this character string
literal in a statement, NonStop SQL/MX returns an error:
_KANJI 'abcd'
To specify a single quotation mark within a string literal, use two consecutive single
quotation marks.
To specify a string literal whose length is more than one line, separate the literal
into several smaller string literals, and use the concatenation operator (||) to
concatenate them.
Case is significant in string literals. Lowercase letters are not equivalent to the
corresponding uppercase letters.
Leading and trailing spaces within a string literal are significant.
SQL/MP Considerations for Character String Literals
SQL/MP Stored Text With Spaces
In NonStop SQL/MX, you cannot put a space between the character set qualifier and
the character string literal in a statement. For example, you must specify
_KANJI'abcd'.
However, NonStop SQL/MP allows a space between the character set qualifier and
character string literal (for example, _KANJI 'abcd'). When NonStop SQL/MX
parses SQL/MP stored text, it accepts the space after the character set qualifier in an
SQL/MP character string literal.
Inserting Into or Updating SQL/MP NCHAR Columns
NonStop SQL/MX supports inserting into or updating columns with the NCHAR data
type in SQL/MP tables. The only restriction is that the NCHAR data being written to the
table contains an even number of bytes.
A string literal used to insert into or update an NCHAR column in an SQL/MP table can
be written:
_UCS2'string'
_UCS2 associates the default character set with the string literal. The default is set by
the value of the NATIONAL_CHARSET attribute during SQL/MX installation. See
National Character Set on page 10-47.
For example, suppose that column K is a UCS2 column in an SQL/MP table named T,
and the NATIONAL_CHARSET is set to UCS2. This statement updates column K:
UPDATE T SET K = N'abcd'