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

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-63
Character String Literals
Because the NATIONAL_CHARSET attribute is set to UCS2, the N'abcd' literal is a
shorter way of writing _UCS2'abcd':
UPDATE T SET K = _UCS2'abcd'
See NCHAR Columns in SQL/MX and SQL/MP Tables on page 6-22.
Inserting Into or Updating SQL/MP Kanji Columns
NonStop SQL/MX Release 2.x supports inserting into or updating columns with the
KANJI or KSC data type in SQL/MP tables.
The only restriction is that the data being written to an SQL/MP table contains an even
number of bytes. SQL/MX character functions that refer to double byte-encoded
characters in KANJI and KSC5601 columns should provide the correct results. For
more details, see the SQL/MX Programming Manual for C and COBOL.
Examples of Character String Literals
These data type column specifications are shown with examples of literals that can
be stored in the columns.
These are string literals:
'This is a string literal.'
'abc^&*'
'1234.56'
'This literal contains '' a single quotation mark.'
This is a string literal concatenated over three lines:
'This MXCI literal is' ||
' in three parts,' ||
'specified over three lines.'
This is a hexadecimal string literal representing the VARCHAR pattern of the ASCII
string 'Strauß':
_ISO88591 X'53 74 72 61 75 DF'
This is a KANJI example for the full-width character string 'ABC':
_kanji x'8261 8262 8263'
This is a KSC5601 example for the full-width character string 'ABC':
-ksc5601 x'A3C1 A3C2 A3C3'
Character String Data Type Character String Literal Example
CHAR (12) UPSHIFT 'PLANNING'
PIC X (12) 'Planning'
VARCHAR (18) 'NEW YORK'