Progress
SQL-92
Guide and Reference
WHENEVER Statement
Specifies actions for three SQL-92 run-time exceptions. This is the syntax for a WHENEVER statement:
SYNTAX
{ NOT FOUND | SQLERROR | SQLWARNING }
{ STOP | CONTINUE | GOTO | GO TO } host_lang_label }
EXAMPLES
- The
STOP
exception results in the ESQLC program stopping execution.- The
CONTINUE
exception results in the ESQLC program continuing execution. The default exception is toCONTINUE
.GOTO
|GO
host_lang_label results in the ESQLC program execution to branch to the statement corresponding to the host_lang_label.The first example is a code fragment from the
main
function in sample program1StatUpd.pc
. The complete source for sample program,1StatUpd.pc
, is listed in Appendix A of the Progress Embedded SQL-92 Guide and Reference .
This example is a code fragment from the dynupd function in sample program
3DynUpd.pc
, which illustrates dynamic processing of an UPDATE statement. The complete source for sample program,3DynUpd.pc
, is listed in Appendix A of the Progress Embedded SQL-92 Guide and Reference .
NOTES
- You can place multiple WHENEVER statements for the same exception in a source file. Each WHENEVER statement overrides the previous WHENEVER statement specified for the same exception.
- Correct operation of a WHENEVER statement with a GOTO host_language_label or a GO TO host_language_label is subject to the scoping rules of the C Language. The host_language_label must be within the scope of all SQL-92 statements for which the action is active. The GO TO or GOTO action is active starting from the corresponding WHENEVER statement until another WHENEVER statement for the same exception, or until end of file.
AUTHORIZATION
None
SQL COMPLIANCE
SQL-92. Progress Extensions: SQLWARNING exception condition and STOP action.
ENVIRONMENT
Embedded SQL-92 only
RELATED STATEMENTS
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |