Entering content frame

 Example for Using WHENEVER Statements 

The following examples show the usage of different WHENEVER statements.

 

EXEC SQL WHENEVER SQLWARNING CALL warnproc();

EXEC SQL SELECT * FROM dual;

/* receives a warning and calls warnproc */

 

EXEC SQL WHENEVER SQLERROR CALL errproc();

EXEC SQL DELETE FROM unknowntable;

/* receives an error and calls errorproc */

 

EXEC SQL WHENEVER SQLERROR STOP;

/* receives also an error but stops execution */

EXEC SQL DELETE FROM unknowntable;

 

Leaving content frame