Neoview Character Sets Administrator's Guide (R2.4, R2.5)

3 Using SQL Language Elements to Define and Manage
Database Encoding
This chapter includes:
“Rules for Encoding SQL Language Elements” (page 23)
“Behavior of SQL Functions” (page 26)
“Behavior of SQL String Functions” (page 27)
“Guidelines for the LIKE Predicate in the SJIS and Unicode Configurations” (page 31)
“Locating Invalid Characters in Syntax Error Messages” (page 33)
Rules for Encoding SQL Language Elements
Table 3-1 describes the rules that govern the use of character set data in SQL language elements
for each of the three Neoview character set configurations.
NOTE: Failure to observe the rules described in Table 3-1 can cause SQL queries to fail and
return error messages.
Table 3-1 Summary of SQL Language Rules by Neoview Character Set Configuration
Unicode ConfigurationSJIS ConfigurationISO88591 ConfigurationSQL Language Rule
DDL and DML Statements
The default column is UCS2,
so you must explicitly specify
CHARACTER SET ISO88591
in the character set value for
any ISO88591 column you
create.
The default column is
ISO88591, so you must
explicitly specify CHARACTER
SET UCS2 in the character
set value for any UCS2
column you create.
The default column is
ISO88591, so you must
explicitly specify CHARACTER
SET UCS2 in the character
set value for any UCS2
column you create.
Explicitly define the
column whenever a
column is not the
default column for the
configuration.
Whenever you explicitly
provide ISO88591 columns
(which contain UTF8 data)
in the Unicode
configuration, make sure
to specify a size (in bytes)
for the column that will be
sufficient to hold your data.
For UTF8 encoding, ASCII
characters require only one
byte, but other character
sets might require two,
three, or even four bytes.
Whenever you use
surrogate Unicode
characters in a UCS2
column, you must specify
a minimum of two
characters in the data type
(for example, CHAR(2)).
You cannot use CHAR(1)
for Unicode surrogate
characters.
When you use SJIS characters
in an ISO88591 column, you
should always double the
number of bytes you would
normally assign to the
character data type. For
example, use CHAR(2)
instead of CHAR(1) and use
CHAR(10) instead of
CHAR(5)
Character data size is in
bytes.
Specify the correct size
for the character data
stored in a column.
Rules for Encoding SQL Language Elements 23