Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateDDL statements → EXCEPTION
Firebird Home Firebird Home Prev: DOMAINFirebird Documentation IndexUp: DDL statementsNext: EXTERNAL FUNCTION

EXCEPTION

CREATE EXCEPTION
CREATE OR ALTER EXCEPTION
RECREATE EXCEPTION

CREATE EXCEPTION

Available in: DSQL, ESQL

Message length increased

Changed in: 2.0

Description: In Firebird 2.0 and higher, the maximum length of the exception message has been raised from 78 to 1021.

Example: 

create exception Ex_TooManyManagers
  'Too many managers: An attempt was made to create more managers than the
   maximum defined in the Limits table. If you really need to create more
   managers than you have now, raise the limit first. However, please consult
   your department''s manager before doing so. Otherwise, your decision may
   be overturned later and the additional manager(s) removed.'

Note

The maximum exception message length depends on a certain system table field. Therefore, pre-2.0 databases need to be backed up and restored under Firebird 2.x before they can store exception messages of up to 1021 bytes.

CREATE OR ALTER EXCEPTION

Available in: DSQL

Added in: 2.0

Description: If the exception does not yet exist, it is created just as if CREATE EXCEPTION were used. If it already exists, it is altered. Existing dependencies are preserved.

Syntax: Exactly the same as for CREATE EXCEPTION.

RECREATE EXCEPTION

Available in: DSQL

Added in: 2.0

Description: Creates or recreates an exception. If an exception with the same name already exists, RECREATE EXCEPTION will try to drop it and create a new exception. This wlll fail if there are existing dependencies on the exception.

Syntax: Exactly the same as CREATE EXCEPTION.

Note

If you use RECREATE EXCEPTION on an exception that has dependent objects, you may not get an error message until you try to commit your transaction.

Prev: DOMAINFirebird Documentation IndexUp: DDL statementsNext: EXTERNAL FUNCTION
Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateDDL statements → EXCEPTION