Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

11.5.2 Obtaining and using detailed error information

When an error occurs in the distributed server and an SQLCODE shown in Table1113 is set in the distributed client, detailed information can be obtained by issuing the GET DIAGNOSTICS statement. The type of the DBMS of the distributed server can also be determined by displaying as part of the detailed information the contents of the SQLCAIDE area of the SQL Communications Areas.

The GET DIAGNOSTICS statement can obtain the following four types of detailed information:

The GET DIAGNOSTICS statement cannot obtain detailed information on an error that occurs while detailed information is being obtained as a result of execution of the GET DIAGNOSTICS statement.

Table 11-13 shows the statement information items that can be obtained by the GET DIAGNOSTICS statement when an error occurs at the distributed server.

Table 11-13 Statement information items obtained by GET DIAGNOSTICS statement when error occurs at distributed server

Statement information item name SQL statement Contents
NUMBER Other than CALL statement 1
CALL statement 1 + number of errors in distributed server diagnostic area
MORE Other than CALL statement N
CALL statement

Y
Number of errors at distributed server is greater than number of errors in distributed server diagnostic area

N
Number of errors at distributed server equals number of errors in distributed server diagnostic area

When an error occurs at the distributed server, condition information items can be obtained by the GET DIAGNOSTICS statement by specifying condition number 1. If a CALL statement error occurs at the distributed server, diagnostic information in the distributed server diagnostic information area can be obtained by the GET DIAGNOSTICS statement by specifying condition number 2 or greater.

Table 11-14 shows the condition information items that can be obtained when an error occurs at the distributed server by specifying condition number 1.

Table 11-14 Condition information items obtained by specifying condition number 1 (error at the distributed server)

Condition information item name Information Contents
RETURNED_SQLCODE Available SQLCODE returned by distributed server1
None 02
ERROR_POSITION None 0
ERROR_SQL_NO None 0
ERROR_SQL None One blank
ROUTINE_TYPE None One blank
ROUTINE_SCHEMA None One blank
ROUTINE_NAME None One blank
MESSAGE_TEXT Available Message text returned by distributed server
None One blank
RDNODE_NAME Available RD node name of distributed server

1 Applicable when the SQLCODE of the distributed server is -861.

2 A 0 is set in SQLCODE because no SQLCODE is returned when the SQLCODE of the distributed server is -862.