community.borland.com

Article #25466: How are Triggers loaded and executed with InterBase v5.x

Problem:
My check constraints don't seem to be enforced at the right time

Solution:
Order in which triggers are loaded (and hence executed) as follows:

   - system triggers sorted by rdb$trigger_sequence

   - 'BEFORE insert/update/delete' user-defined triggers sorted by
     rdb$trigger_sequence (triggers with the same sequence number are executed
     in alphabetic order)

   - check constraint triggers

   - 'AFTER insert/update/delete' user-defined triggers sorted by
     rdb$trigger_sequence (triggers with the same sequence number are executed
     in alphabetic order)

To make it work, you have to backup and restore existing databases. The fix
will re-arrange the order in which triggers are loaded (as described above) 
during restore.

Last Modified: 26-OCT-00