Show TOC

Indicating Trigger Order for Multiple TriggersLocate this document in the navigation structure

Some DBMSs allow you to have multiple triggers for the same insert, update, or delete event at the same time. You can indicate the order in which each trigger within the group fires.

Context

In the following example, a company is considering candidates for various positions, and must ensure that new employees are offered a salary that is within the range of others working in the same field, and less than their prospective manager.

The EMPLOYEE table contains two BeforeInsert triggers to perform these tests:
create trigger tibTestSalry1 before insert order 1 on EMPLOYEE
referencing new as new_ins for each row
begin
  
 [Trigger code]
 
end

create trigger tibTestSalry2 before insert order 2 on EMPLOYEE
begin
  
 [Trigger code]
 
end

Procedure

  1. Open the trigger property sheet and click the Body tab.
  2. Select a number from the Order list to indicate the position in which the trigger fires.
  3. Click OK to return to your model.