GNADE User's Guide: GNADE, The GNat Ada Database Environment; Version 1.4.2; Document Revision $Revision: 1.40 $ | ||
---|---|---|
Prev | Chapter 11. Embedded SQL Syntax Specification | Next |
The clause may be used to define the handling of certain conditions after a query. The result of the query is evaluated and the action as defined in the action clause is executed.
Syntax: <embedded exception declaration> ::= WHENEVER <condition> <condition action> <condition> ::= SQLERROR | NOT FOUND | SQLWARNING <condition action> ::= CONTINUE | <go to> | RAISE <host_exception> | DO <target> | STOP <go to> ::= { GOTO | GO TO } <goto target> <goto target> ::= <host label identifier>
A defined condition is applies to the next SQL query. By using the switch -noiso92 the code generator may be forced to apply whenever clause to all embedded SQL statements until the next whenever clause occurs.
Table 11-1. Exception Actions
GOTO | The translator inserts a goto statement to the label specified in the target. |
RAISE | The translator inserts a raise statement with an exception as specified in the target. The exception information will contain the line number of the query in the input source file and the package name. Additionally the contents of the message in the SQLCA is added. |
DO | The procedure named in the target specification is called. |
CONTINUE | This clause will reset all previous actions for the given condition. |