SQLIMSSTATE

IMS sets SQLIMSSTATE after each SQL statement is executed. IMS returns values that conform to the error specification in the SQL standard. Thus, application programs can check the execution of SQL statements by testing SQLIMSSTATE instead of SQLIMSCODE.

SQLIMSSTATE provides application programs with common codes for common error conditions (the values of SQLIMSSTATE are product-specific if the error or warning is product-specific). Furthermore, SQLIMSSTATE is designed so that application programs can test for specific errors or classes of errors.

In the case of a LOOP statement, the SQLIMSSTATE is set after the END LOOP portion of the LOOP statement completes. With the REPEAT statement, the SQLIMSSTATE is set after the UNTIL and END REPEAT portions of the REPEAT statement completes.