Firebird Documentation IndexIsql - Interactive SQL → Error Handling And Exception Support
Firebird Home Firebird Home Prev: Isql PromptsFirebird Documentation IndexUp: Isql - Interactive SQLNext: Transaction Handling

Error Handling And Exception Support

Exception handling is a programming construct designed to handle an occurrence that disrupts the normal execution of a program. These are called errors. Exceptions are user-defined named error messages, written specifically for a database and stored in that database for use in stored procedures and triggers.

For example, if it is ascertained in a trigger that the value in a table is incorrect, the exception is fired. This leads to a rollback of the total transaction that the client application is attempting to commit. Exceptions can be interleaved, and shared among the different modules of an application, and even among different applications sharing a database. They provide a simple way to standardize the handling of preprogrammed input errors.

Exceptions are database objects, like Tables, Views and Domains, and are part of the database's meta data. They can be created, modified and dropped like all other Firebird objects using isql.

In isql, error messages comprise the SQLCODE variable and the Firebird status array. The following table provides some examples:

Table 2. ISQL Error Codes and Messages

SQLCODE

Message

Meaning

<0

SQLERROR

Error occurred: statement did not execute

0

SUCCESS

Successful execution

+1 to +99

SQLWARNING

System warning or information message

+100

NOT FOUND

No qualifying rows found, or end of current active set of rows reached


Prev: Isql PromptsFirebird Documentation IndexUp: Isql - Interactive SQLNext: Transaction Handling
Firebird Documentation IndexIsql - Interactive SQL → Error Handling And Exception Support