SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual523725-004
6-65
Datetime 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/MP Tables on page 6-23.
Inserting Into or Updating SQL/MP Kanji Columns
NonStop SQL/MX 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 the table contains an even number
of bytes. SQL/MX functions have some limitations when used with KANJI or KSC data
types. For more information, 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'
Datetime Literals
SQL/MP Considerations for Datetime Literals
Character String Data Type Character String Literal Example
CHAR (12) UPSHIFT 'PLANNING'
PIC X (12) 'Planning'
VARCHAR (18) 'NEW YORK'