SQLIMSCODE
The SQLIMSCODE is also set by IMS after each SQL statement is executed.
IMS conforms to the SQL standard as follows:
- If SQLIMSCODE = 0 and SQLIMSWARN0 is blank, execution was successful.
- If SQLIMSCODE = 100, "no data" was found. For example, a FETCH statement returned no data because the cursor was positioned after the last row of the result table.
- If SQLIMSCODE > 0 and not = 100, execution was successful with a warning.
- If SQLIMSCODE = 0 and SQLIMSWARN0 = 'W', execution was successful with a warning.
- If SQLIMSCODE < 0, execution was not successful.
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.
The SQL standard does not define the meaning of any other specific positive or negative values of SQLIMSCODE, and the meaning of these values is product specific.