Table 4-2 Setting LANG, PDLANG, and PDCLTCNVMODE during execution of pddef
Input character codes | Character codes set for the HiRDB server used to register definitions1 | Character codes in the pddef execution environment | ||
---|---|---|---|---|
LANG2 | PDLANG3 | PDCLTCNVMODE3 | ||
SJIS (Shift JIS Kanji codes) | SJIS | SJIS | Linux version: SJIS Other: Omitted | Omitted |
UJIS (EUC Japanese Kanji codes) | UJIS | UJIS | Omitted | |
C (single-byte character codes) | C | C | Omitted | |
chinese (EUC Chinese-language Kanji codes) | chinese | chinese | CHINESE | |
UTF-8 (Unicodes) | UTF-8 | Any (C is recommended) | UTF-8 |
1 This is the value set in the -c option of the pdsetup command.
2 The value of the LANG environment variable depends on the OS. For details about the character codes specified in LANG, see the HiRDB Version 8 UAP Development Guide.
3 For details about PDLANG and PDCLTCNVMODE, see the HiRDB Version 8 UAP Development Guide.
The results of the database definition utility can be checked by the return code set by the utility or by referencing a data dictionary table. The return codes are as follows:
Return code | Meaning | Action | HiRDB operation |
---|---|---|---|
0 | Normal termination (including when an SQL statement resulted in an error) | Not applicable | Not applicable |
8 | Memory shortage | Re-execute after another process has terminated, or increase memory. | Cancels processing and terminates pddef |
Option specification error | Specify the correct option. |
Return code | Meaning | Action | HiRDB operation |
---|---|---|---|
0 | Normal termination | Not applicable | Not applicable |
4 | HiRDB connection error | Check and, if necessary, revise the specified environment variables. | Cancels processing and terminates pddef |
SQL error | Check and, if necessary, revise the executed SQL statement. | Resumes processing | |
8 | Memory shortage | Re-execute after another process has terminated, or increase memory. | Cancels processing and terminates pddef |
Option specification error | Specify the correct option. |
If any of the SQL statements listed below results in an error, the GET DIAGNOSTICS statement can be executed to display error information (if the SQL statement contains a comment, ERROR_POSITION will display the values only without the comment):
Figure 4-2 shows the format of error information.
Figure 4-2 Format of error information
The system regards any data beginning with /* in an SQL statement as a comment. All characters following /* (including semicolons) are handled as part of the comment. The system regards the first */ that follows /* as the end of the comment.
The following shows examples:
Example 1:
CREATE TABLE T1 (C1 INT) ; /* CU ADDRESS TABLE */ ...Start and end of comment
Example 2:
CREATE TABLE T1 /* CU ADDRESS TABLE */ (C1 INT) ; ...Start and end of comment
Example 3:
CREATE TABLE T1 /* CU ADDRESS ...Start and continuation of comment
TABLE */ (C1 INT) ; ...............End of comment
Example 4:
CREATE TABLE T1 /* CU ADDRESS TABLE * (C1 INT) ; ...Start and continuation of comment
Example 5:
CREATE TABLE T1 /* CU /* ADDRESS */ TABLE */ (C1 INT) ;
...Start and end of comment
Data from /* to */ that is enclosed in double quotation marks (") or single quotation marks (') is not handled as a comment. For details about specifying comments, see the description of the SQL specification format in the manual HiRDB Version 8 SQL Reference. Note that this utility's handling of comments is different from the interactive SQL execution utility (pdsql).
If you selected utf-8 as the character encoding in the pdsetup command, you can use a file with a BOM as the input file for pddef. Note that even when a file with a BOM is used as the input file for pddef, the BOM is skipped.