Firebird Documentation Index → Firebird 3.0.6 Release Notes → Procedural SQL (PSQL) → SQLSTATE in Exception Handlers |
An SQLSTATE code becomes a valid condition for trapping an exception with a WHEN statement. In alignment with SQLCODE and GDSCODE, the SQLSTATE code can be used as in the following snippet:
... WHEN SQLSTATE '22006' DO BEGIN -- do something END ...
SQLSTATE codes are string literals.
Firebird Documentation Index → Firebird 3.0.6 Release Notes → Procedural SQL (PSQL) → SQLSTATE in Exception Handlers |