Table 1-1 shows the characters that are available in SQL.
Table 1-1 SQL character set
Type | Permissible characters in SQL |
---|---|
Character string literal | One-byte character codes (not including X'00') |
National character string literal | All two-byte code characters |
Mixed character string literal | One-byte character codes (not including X'00') and all two-byte code characters |
Other than above |
|
Other than above | Question mark (?) Colon (:) Semicolon (;) Percent sign (%) Vertical bar (|) Left bracket ([) Right bracket (]) TAB (X'09') NL (X'0a') CR (X'0d') |
Characters that can be used in SQL vary depending on the character code type specified in the pdsetup command. For details about the pdsetup command, see the manual HiRDB Version 8 Command Reference.
SQL allows the use of one-byte and two-byte characters. These two types of characters require different character codes (two-byte characters are not available among the single-byte character codes). The following table shows the relationships between characters and the character code types:
Specified character code | Single-byte character | Double-byte character | Remarks | |
---|---|---|---|---|
Multiple -byte character code | sjis1, 4 (Shift JIS kanji) | JISX0201 | JISX0208 | Double-byte characters include gaiji characters. |
ujis3 (EUC Japanese kanji) | JISX0201 | JISX0208 | Double-byte characters do not include gaiji characters.2 | |
chinese (EUC Chinese kanji) | ISO-8859-1 (Exclusive of 80-FF) | GB2312-80 | Double-byte characters do not include gaiji characters2 | |
utf-84, 5 (Unicode (UTF-8)) | JISX0221 | JISX0221 | Double-byte characters include gaiji characters. Within the ASCII code range, these characters are treated identically with other character codes, except that in some cases a single character may be represented in 6 bytes.6 | |
MS-Unicode | MS-Unicode | |||
Single-byte character code | lang-c3 (8-bit code) | Same as the specified code | ![]() | These codes can be used in US ASCII and 8-bit codes. |
If the HiRDB External Data Access facility is used in an HiRDB using multi-byte character codes, you can use either the shift JIS kanji code or the EUC Japanese kanji code. Therefore, for the character code to be set in the pdsetup command, you need to specify either sjis or ujis.
In addition, for access to a foreign server using either the shift JIS kanji code or the EUC Japanese kanji code, you need to provide appropriate settings for the foreign server or the client for the foreign server. For details about settings for foreign servers and foreign server clients, see the appropriate DBMS manuals. The relationship between a foreign server and HiRDB character codes is shown as follows:
Type of foreign server | Foreign server character code | HiRDB character code | |
---|---|---|---|
Shift JIS kanji | EUC Japanese kanji | ||
HiRDB | Shift JIS Japanese kanji | Y | N |
EUC Japanese kanji | N | Y | |
XDM/RD E2 | EBCDIK or KEIS | Y1 | N |
ORACLE | Shift JIS kanji | Y | Y1 |
EUC Japanese kanji | Y1 | Y | |
DB2 | 2-byte EBCDIC | Y1 | Y1, 2 |
1-byte, 2-byte mixed ASCII | Y1 | Y1, 2 |