SQL/MX 3.2.1 Management Manual (H06.26+, J06.15+)

Defining Character Data
NonStop SQL/MX includes both fixed-length character data and variable-length character data.
The data types for character data are:
CHARFixed-length characters
PIC
NCHAR, NATIONAL
CHAR, or NATIONAL
CHARACTER
CHAR VARYINGVariable-length characters
VARCHAR
NCHAR VARYING or
NATIONAL CHAR
VARYING
For NonStop SQL/MX, the maximum row size is approximately 32 KB, provided the Control Query
Default DEFAULT_BLOCKSIZE is set to 32768. However, the actual row size is less because of
bytes used by the header, null indicator, column length indicator, and other system features. For
more information, see the SQL/MX Reference Manual.
Fixed-length and variable-length character data can be associated with a character set by specifying
the CHARACTER SET clause on the host variable declaration.
A character data type is compatible with another character data type with the same character set.
It is not compatible with numeric, datetime, or interval data types, or with character data associated
with a different character set.
You can specify one of these two character sets for an SQL/MX table column:
ISO88591 is a default single-byte 8-bit character set for character data types. It supports
English and other Western languages.
USC2 is a double-byte Unicode character set in UTF16 big-endian encoding. All Basic
Multilingual Plan (BMP) characters are included. Surrogate characters are treated as two
double-byte characters.
You define the national character set for NCHAR and NCHAR VARYING columns in SQL/MX
tables when you run the InstallSqlmx script to initialize NonStop SQL/MX. The value for the
InstallSqlmx -n option can be ISO88591, UCS2, KANJI, or KSC5601. However, if you
specify KANJI or KSC5601 and later attempt to create an SQL/MX table with an NCHAR column,
you receive an error message because SQL/MX tables do not support the KANJI or KSC5601
character sets. If you do not specify a value for the -n option, the national character set defaults
to UCS2. For more information, see SQL/MX Installation and Upgrade Guide.
Restrictions on Using Character Set Data
Use only ISO88591 characters in these contexts:
Where FoundISO88591 Field
CREATE INDEX, CREATE TABLEBY partitioning-column
CREATE TABLE, ALTER TABLECHECK constraint text
CREATE TABLE, ALTER TABLE, CREATE VIEWColumn default values
CREATE TABLE, ALTER TABLEColumn HEADING text
CREATE TABLE, CREATE INDEX, MODIFY TABLEFIRST KEY values
CREATE PROCEDUREsql-datatype character string data types
90 Creating an SQL/MX Database