Nonstop Database, HiRDB Version 9 UAP Development Guide
The organization and contents of the area that receives SQL execution information are explained as follows.
The following figure shows the organization of the SQL Communications Area.
Figure A-1 Configuration of SQL Communications Area
The following table shows the contents of the SQL Communications Area.
Table A-1 Contents of the SQL Communications Area
Level number#1 | Communications area name | Data type | Length (bytes) | Description |
---|---|---|---|---|
1 | SQLCA | -- | 336 [368] | Denotes the overall SQL Communications Area. |
2 | SQLCAID | -- | 8 | Denotes the SQLCAIDC, SQLCAIDS, and SQLCAIDE areas. |
3 | SQLCAIDC | char | 5 | Contains a character string (SQLCA) indicating that the area is the SQL Communications Area. |
3 | SQLCAIDS | char | 2 | Used by HiRDB. |
3 | SQLCAIDE | char | 1 | Used by HiRDB. |
2 | SQLCABC | long | 4 [8]#3 | Sets the size (336 [368] bytes) of the SQL Communications Area. |
2 | SQLCODE | long | 4 [8]#3 | Receives one of the following return codes from HiRDB after SQL statements have been executed: Negative: Abnormal termination 0: Normal termination Positive: Normal termination with a message For details about the messages associated with return codes, see the manual HiRDB Version 9 Messages. Return codes associated with messages are retrieved as follows: Return code Associated message ID -yyy KFPA11yyy -1yyy KFPA19yyy -3yyy KFPA18yyy yyy KFPA12yyy 3yyy KFPA13yyy Examples: Return code Message ID -125 KFPA11125 -1200 KFPA19200 -3200 KFPA18200 100 KFPA12100 3010 KFPA13010 |
2 | SQLERRM | -- | 256 | Denotes the SQLERRML and SQLERRMC areas. The contents of these areas vary depending on whether the return code returned to the SQLCODE area is positive or negative:
|
3 | SQLERRML | short | 2 | Contains the length of the message returned to the SQLERRMC area. |
3 | SQLERRMC | char | 254 | Contains the message associated with the return code returned to the SQLCODE area; for the contents of this area, see the manual HiRDB Version 9 Messages. |
2 | SQLERRP | char | 8 | Used by HiRDB. |
2 | SQLERRD | long | 4#3 x 6 | Contains the internal status of HiRDB. This area is an array of six areas of the long data type: SQLERRD[0]: Not used SQLERRD[1]: Not used SQLERRD[2]: When SQLCODE is 0 or a positive value: One of the following values.
A value is returned indicating the array element that resulted in an error during update processing using the array.#4 SQLERRD[3]: Used by the system. SQLERRD[4]: Used by the system. SQLERRD[5]: Not used |
2 | SQLWARN0 | char | 1 | W is set in this area when a warning flag (W) is set in any of the areas SQLWARN1-SQLWARNF. |
2 | SQLWARN1 | char | 1 | W is set in this area if an embedded variable for receiving data during character data retrieval was shorter than the data, and the truncated value was received. W is also set if the embedded variable for receiving data during repetition retrieval had a smaller element count than the data and values of the discarded elements that were received; otherwise, this area is empty. |
2 | SQLWARN2 | char | 1 | W is set in this area if the null value was ignored in set function processing; otherwise, this area is empty. However, in either of the following cases, a space may be set in this area even if the null value was ignored during set function processing:
|
2 | SQLWARN3 | char | 1 | W is set in this area if the number of columns containing the results of a retrieval did not match the number of embedded variables that received the results of the retrieval; otherwise, this area is empty. |
2 | SQLWARN4 | char | 1 | W is set in this area if an UPDATE or DELETE statement without a WHERE clause was executed; otherwise, this area is empty. |
2 | SQLWARN5 | char | 1 | Spare |
2 | SQLWARN6 | char | 1 | W is set in this area if the transaction was cancelled implicitly; otherwise, this area is empty. |
2 | SQLWARN7 | char | 1 | W is set in this area if a repetition column with subscripts is specified in the SET or DELETE clause of the UPDATE statement, and the update is ignored because there are no elements in the row to be updated; otherwise, this area is empty. |
2 | SQLWARN8 | char | 1 | Spare |
2 | SQLWARN9 | char | 1 | Spare |
2 | SQLWARNA#2 | char | 1 | W is set in this area if an invalid date occurred as a result of a date operation and HiRDB modified the date automatically to the last day of the affected month; otherwise, this area is empty. |
2 | SQLWARNB#2 | char | 1 | W is set in this area if either an overflow error or division by zero error occurred in a computation during SQL statements execution and the result of the computation was set as a null value. Otherwise, this area is empty. |
2 | SQLWARNC#2 | char | 1 | W is set in this area when the value for a day in a date interval is more than two digits after a date operation has been completed; otherwise, this area is empty. |
2 | SQLWARND | char | 1 | Used by HiRDB. |
2 | SQLWARNE | char | 1 | Spare |
2 | SQLWARNF | char | 1 | Spare |
2 | SQLCASYS | char | 16 | Used by HiRDB. |
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.