WHENEVER

Syntax

WHENEVER SQLERROR|OSERROR EXIT [<exit_code>]|CONTINUE|ABORT [ROLLBACK|COMMIT];

Description

This statement defines the behavior of EXAplus in the event of errors. WHENEVER SQLERROR responds to errors in the execution of SQL statements, WHENEVER OSERROR to operating system errors (file not found, etc.).

The behavior can be specified as follows:

Command Description
EXIT Quits EXAplus.
CONTINUE Continues program operation despite the occurrence of an error.
ABORT Aborts the execution of statements, but doesn't close EXAplus.

CONTINUE is the default setting for both types of error (and EXIT if EXAplus is started with the parameter -x).

Examples

whenever sqlerror continue;
whenever sqlerror exit 4;