Previous Topic: Error ProcedureNext Topic: EXEC SQL Statement (SQL Access)


Notes for SQL Access

The error procedure is not invoked if the database management system detects errors in embedded SQL statements. They are governed by the WHENEVER statement in SQL. However, you can include a DO ERROR statement in embedded SQL to invoke the error procedure.

You can call the program @I$TIAR from the error procedure to format SQL codes into text messages. For more information regarding non‑Ideal utility programs, see the Utility Programs appendix.

Example

Following is CA Ideal default error processing:

<<ERROR>> PROCEDURE
       IF $RC LT 12
          SET $RC EQ 12
       ENDIF
       LIST ERROR
       BACKOUT
       QUIT RUN
       ENDPROC

This is an example of an error procedure that you can use in your CA Ideal program:

<<ERROR>> PROCEDURE
        DO LOG‑MSG
        PROCESS NEXT EMP‑DVW
ENDPROC