6.1.3 Characters permitted in SQL statements
The following table lists the characters that are permitted in SQL statements.
No. |
Type |
Characters permitted in SQL statements |
---|---|---|
1 |
Character string literals |
All characters except for the character encoding X'00' |
2 |
Other than above |
|
- Organization of this subsection
(1) Character encodings permitted in SQL statements
The character encodings that are permitted in SQL statements depend on the character encoding being used by HADB. The following table shows the relationship between the character encoding used by HADB and the character encodings permitted in SQL statements.
Character encoding used by HADB |
Character encodings permitted in SQL statements |
---|---|
Unicode (UTF-8) |
JIS X 0221 |
Shift-JIS |
JIS X 0201 and JIS X 0208 |
(2) Character handling
In character string data, each character takes up a certain number of bytes. This number is determined according to the relationship between the character encoding range and the required number of bytes, shown in the table below. If the number of bytes to the end of the character string data is less than the required number of bytes, the data is assumed to begin with a one-byte character consisting of the first byte, and the next byte is assumed to be the starting point for the next character.
Character encoding used by HADB |
Range of first byte |
Range of second and subsequent bytes |
Required number of bytes |
---|---|---|---|
Unicode (UTF-8) |
0x00 to 0x7F |
-- |
1 |
0xC0 to 0xDF |
N |
2 |
|
0xE0 to 0xEF |
N |
3 |
|
0xF0 to 0xF7 |
N |
4 |
|
0xF8 to 0xFB |
N |
5 |
|
0xFC to 0xFD |
N |
6 |
|
Other than above |
-- |
1 |
|
Shift-JIS |
0x00 to 0x7F |
-- |
1 |
0x81 to 0x9F |
0x40 to 0x7E or 0x80 to 0xFC |
2 |
|
Other than above |
1 |
||
0xA1 to 0xDF |
-- |
1 |
|
0xE0 to 0xFC |
0x40 to 0x7E or 0x80 to 0xFC |
2 |
|
Other than above |
1 |
||
Other than above |
-- |
1 |
- Legend:
-
N: No range specified.
--: Not applicable.