Handling InterBase Errors

From InterBase
Jump to: navigation, search

Go Up to Handling Errors

Procedures can also handle InterBase errors. For example, suppose a statement in a procedure attempts to update a row already updated by another transaction, but not yet committed. In this case, the procedure might receive an InterBase error LOCK_CONFLICT. If the procedure retries its update, the other transaction might have rolled back its changes and released its locks. By using a WHEN GDSCODE statement, the procedure can handle lock conflict errors and retry its operation.

To handle InterBase error codes, use the following syntax:

WHEN GDSCODE errcode DO <compound_statement>;

For more information about InterBase error codes, see the Language Reference Guide.

Advance To: