Scalable Database Server, HiRDB Version 8 UAP Development Guide

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

3.6.2 Automatic error identification

When WHENEVER statements are used, errors can be detected automatically.

WHENEVER statements can identify the following conditions:

For details about the WHENEVER statement, see the HiRDB Version 8 SQL Reference manual.

(a) Identification of an error occurrence (SQLCODE<0)

Determined by using the WHENEVER statement where SQLERROR is specified. When an error occurs, the system shifts to the specified measure. If an error referencing operation is specified, the return codes and related information can be referenced.

(b) No more rows to be retrieved (SQLCODE=100)

Determined by using the WHENEVER statement where NOT FOUND is specified. By specifying the process to be taken when there are no more lines to be searched, the system shifts to the specified measure.

(c) Whether or not warning information is present in normal termination (SQLWARN0='W', or SQLCODE>0 but SQLCODE[Figure]100)

Determined by using the WHENEVER statement where SQLWARNING is specified. When a measure to be taken when warning information is present in normal termination is specified, the system shifts to the specified measure only when warning information is present.

When a search using a list is executed, normal termination without any data (a row that was present when the list was created has been deleted) may occur. If SQLCODE is 110 or SQLSTATE is R2000, the UAP must determine that normal termination without any data occurred and skip the processing for selection rows.