Scalable Database Server, HiRDB Version 8 UAP Development Guide
The organization and contents of the area that receives SQL execution information are explained as follows.
Figure A-1 shows how the SQL Communications Area is organized.
Figure A-1 Configuration of SQL Communications Area
Table A-1 shows the contents of the SQL Communications Area.
Table A-1 Contents of the SQL Communications Area
Level number1 | 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 |
2 | SQLCABC | long | 4 [8]6 | Sets the size (336 [368] bytes) of the SQL Communications Area. |
2 | SQLCODE | long | 4 [8]6 | 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 8 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 8 Messages. |
2 | SQLERRP | char | 8 | Used by HiRDB. |
2 | SQLERRD | long | 46 [86]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]: One of the following values.3
SQLERRD[4]: Not used 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 blank. |
2 | SQLWARN2 | char | 1 | W is set in this area if the null value was ignored in set function processing; otherwise, this area is blank. However, in either of the following cases, a blank 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 blank4. |
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 blank. This area is not used in remote database access. |
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 blank. |
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 blank. This area is not used in remote database access. |
2 | SQLWARN8 | char | 1 | Spare |
2 | SQLWARN9 | char | 1 | Spare |
2 | SQLWARNA5 | 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 blank. This area is not used in remote database access. |
2 | SQLWARNB5 | 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 blank. This area is not used in remote database access. |
2 | SQLWARNC5 | 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 blank. This area is not used in remote database access. |
2 | SQLWARND | char | 1 | W is set in this area when a warning that occurs in a foreign server cannot be classified into other types of SQLWARN. |
2 | SQLWARNE | char | 1 | Spare |
2 | SQLWARNF | char | 1 | Spare |
2 | SQLCASYS | char | 16 | Used by HiRDB. |
Value | Server's database management system | Remote database access protocol |
---|---|---|
K | SQL/K | OSI-RDA |
O | ORACLE | OSI-RDA |
P | HiRDB | OSI-RDA |
R | XDM/RD | OSI-RDA |
1 | RDB1 E2 | OSI-RDA |
(Blank) | Local access | Not applicable |
Other | One of the following:
|
OSI-RDA |
Returned value | DBMS at server | |
---|---|---|
HiRDB and XDM/RD | Other than HiRDB or XDM/RD | |
Number of rows fetched by the SELECT statement | These values are set. | These values are set when a rows count is returned from the server DBMS; otherwise, 0 is set. |
Number of rows updated by the UPDATE statement | ||
Number of rows deleted by the DELETE statement | ||
Number of rows inserted by the INSERT statement | ||
Number of rows fetched by the FETCH statement | These values are set. | |
Number of rows created by the ASSIGN LIST statement | These values are not usable. | These values are not usable. |
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.