| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- ------------------
- Exception handling
- ------------------
- The common syntax rules for EXCEPTION statement is:
- EXCEPTION [[name] [value]];
- Run-time exception messages (FB 1.5)
- ------------------------------------
- Function:
- Allows to throw exceptions with text message
- defined at runtime.
- Author:
- Dmitry Yemanov <[email protected]>
- Syntax rules:
- EXCEPTION <exception_name> <message_value>;
- Scope:
- PSQL
- Example(s):
- 1. EXCEPTION E_EXCEPTION_1 'Error!';
- 2. EXCEPTION E_EXCEPTION_2 'Wrong type for record with ID=' || new.ID;
- Exception re-raise semantics (FB 1.5)
- -------------------------------------
- Function:
- Allows to re-initiate catched exception.
- Author:
- Digitman <[email protected]>
- Syntax rules:
- EXCEPTION;
- Scope:
- PSQL, context of the exception handling block
- Example(s):
- BEGIN
- ...
- WHEN SQLCODE -802 THEN
- EXCEPTION E_ARITH_EXCEPT;
- WHEN SQLCODE -802 THEN
- EXCEPTION E_KEY_VIOLATION;
- WHEN ANY THEN
- EXCEPTION;
- END
- Note(s):
- Evaluates to no-op if used outside the exception handling block.
- Run-time error codes (FB 1.5)
- -----------------------------
- Function:
- Allows to get a numeric error code for the catched exception.
- Author:
- Dmitry Yemanov <[email protected]>
- Syntax rules:
- SQLCODE / GDSCODE;
- Scope:
- PSQL, context of the exception handling block
- See also:
- README.context_variables
|