Firebird Documentation IndexFirebird 1.5 Language Ref. UpdateDDL statements → ALTER TRIGGER
Firebird Home Firebird Home Prev: ALTER TABLEFirebird Documentation IndexUp: DDL statementsNext: CREATE DATABASE

ALTER TRIGGER

Multi-action triggers
ALTER TRIGGER no longer increments table change count
PLAN allowed in trigger code

Available in: DSQL, ESQL

Multi-action triggers

Added in: 1.5

Description: The ALTER TRIGGER syntax has been extended to support multi-action triggers. For a full discussion of this feature, see CREATE TRIGGER :: Multi-action triggers.

Syntax: 

ALTER TRIGGER trigger-name
   [ACTIVE | INACTIVE]
   {BEFORE | AFTER} <actions>
   [POSITION number]
   AS
   <trigger_body>

<actions>       ::= <single_action> [OR <single_action> [OR <single_action>]]
<single_action> ::= INSERT | UPDATE | DELETE

ALTER TRIGGER no longer increments table change count

Changed in: 1.0

Description: Each time you use CREATE, ALTER or DROP TRIGGER, InterBase increments the metadata change counter of the associated table. Once that counter reaches 255, no more metadata changes are possible on the table (you can still work with the data though). A backup-restore cycle is needed to reset the counter and perform metadata operations again.

While this obligatory cleanup after many metadata changes is in itself a useful feature, it also means that users who regularly use ALTER TRIGGER to deactivate triggers during e.g. bulk import operations are forced to backup and restore much more often then needed.

Since changes to triggers don't imply structural changes to the table itself, Firebird no longer increments the table change counter when CREATE, ALTER or DROP TRIGGER is used. One thing has remained though: once the counter is at 255, you can no longer create, alter or drop triggers for that table.

PLAN allowed in trigger code

Changed in: 1.5

Description: Before Firebird 1.5, a trigger containing a PLAN statement would be rejected by the compiler. Now a valid plan can be included and will be used.

Prev: ALTER TABLEFirebird Documentation IndexUp: DDL statementsNext: CREATE DATABASE
Firebird Documentation IndexFirebird 1.5 Language Ref. UpdateDDL statements → ALTER TRIGGER