Checking the execution of SQL statements by using the SQLIMSCA
One way to check whether an SQL statement executed successfully is to use the SQL communication area (SQLIMSCA). This area is set apart for communication with IMS.
If you use the SQLIMSCA, include the necessary instructions to display information that is contained in the SQLIMSCA in your application program.
- When IMS processes an SQL statement, it places return codes that indicate the success or failure of the statement execution in SQLIMSCODE and SQLIMSSTATE.
- When IMS processes a FETCH statement, and the FETCH is successful, the contents of SQLIMSERRD(3) in the SQLIMSCA is set to the number of returned rows.
- When IMS processes a FETCH statement, the contents of SQLIMSCODE is set to +100 if the last row in the segment has been returned with the set of rows.
- When IMS processes an UPDATE, INSERT, or DELETE statement, and the statement execution is successful, the contents of SQLIMSERRD(3) in the SQLIMSCA is set to the number of rows that are updated, inserted, or deleted.