Nonstop Database, HiRDB Version 9 UAP Development Guide
For UAPs that use the Unicode functionality of COBOL2002, you can use Japanese data items for storing UTF-16 character data as embedded variables.
The following table shows the character codes and character data in UAPs that use the Unicode functionality of COBOL2002.
Table 8-27 Character codes and character data in UAPs that use the Unicode functionality of COBOL2002
| Character data in UAP | Character codes | |
|---|---|---|
| SQL statements | UTF-8 | |
| Embedded variables | Alphanumeric data items | UTF-8 |
| Japanese data items | UTF-16LE or UTF-16BE | |
The following table describes the character code conversion performed by the HiRDB server when UAPs that use the Unicode functionality of COBOL2002 execute SQL statements.
Table 8-28 Character code conversion performed by the HiRDB server when UAPs that use the Unicode functionality of COBOL2002 execute SQL statements.
| Character data in UAP | Character code conversion performed by the HiRDB server when SQL statements are executed | |
|---|---|---|
| SQL statement | No conversion is performed because the client and server both use UTF-8 character codes. | |
| Embedded variable | Alphanumeric data item | Character codes are converted if the character set of character data used by the server that is subject to assignment and comparison processing is UTF-16.# |
| Japanese data item | Character codes are converted if the character set of character data used by the server that is subject to assignment and comparison processing is the default character set (UTF-8).# If the pre-conversion data contains single-byte characters, the single-byte characters (double-byte characters in UTF-16) are stored. Data in embedded variables is treated as having the character data type (CHAR or VARCHAR) for which the character set name, UTF-16LE or UTF-16BE, has been specified according to the -XU16 option. |
|
In order to execute the SQL statements by a UAP that uses the Unicode functionality of COBOL2002, all the following conditions must be satisfied:
If you specify utf-8 as the character code classification in the pdntenv command (in the UNIX edition, pdsetup command), the HiRDB server's default character set is set to UTF-8.
For details about the -XU16 option, see Table 8-5 Preprocessing options (for COBOL in the UNIX environment) or Table 8-11 Preprocessing options (for COBOL in the Windows environment).
An error will occur during preprocessing if an embedded SQL statement in the UAP source contains characters in JIS X0213 level 3 or 4 kanji codes. For character data stored in embedded variables, you must use characters in the range supported by the Unicode functionality of COBOL2002.
You must specify NOUSE in the PDCLTCNVMODE client environment definition in order to prevent the HiRDB client from performing character code conversion.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.