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

WHENEVER 
  { NOT FOUND | SQLERROR | SQLWARNING } 
  { STOP | CONTINUE | { GOTO | GO TO } host_lang_label } ; 

{ NOT FOUND | SQLERROR | SQLWARNING }
{ STOP | CONTINUE | GOTO | GO TO } host_lang_label }
EXAMPLES

The first example is a code fragment from the main function in sample program 1StatUpd.pc. The complete source for sample program, 1StatUpd.pc, is listed in Appendix A of the Progress Embedded SQL-92 Guide and Reference .

/* 
**  Name WHENEVER routine to handle SQLERROR condition. 
*/ 
EXEC SQL WHENEVER SQLERROR GOTO mainerr ; 

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 .

/* 
**    Name WHENEVER routines to handle NOT FOUND and SQLERROR 
*/ 
EXEC SQL WHENEVER SQLERROR GOTO nodyn ; 
EXEC SQL WHENEVER NOT FOUND GOTO nodyn ; 

NOTES

AUTHORIZATION

None

SQL COMPLIANCE

SQL-92. Progress Extensions: SQLWARNING exception condition and STOP action.

ENVIRONMENT

Embedded SQL-92 only

RELATED STATEMENTS

FETCH Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095