Before Oracle 11g, the order in which triggers of same type fire was arbitrary without any underlying principle or logic.
But now with Oracle 11g, the sequence of trigger firing of same type on same table can be control through use of new FOLLOWS clause.
With this new FOLLOWS clause, one can specify after which other trigger of the same type the trigger should fire.
Example:
Let suppose we have a table called “item_ledger”.
and we have one trigger called “itemledger_trg” as follows:
CREATE OR REPLACE itemledger_trg
BEFORE INSERT
ON item_ledger
FOR EACH ROW
BEGIN
……….
END;
Now we want to create another trigger called “account_trg” which should fire after “itemledger_trg”.
In Oracle 11g we can do as follows:
CREATE OR REPLACE account_trg
BEFORE INSERT
ON item_ledger
FOR EACH ROW
FOLLOWS itemledger_trg
BEGIN
……….
END;
Reference:Jurgen Kemmelings
2 responses so far ↓
1 anonymous // Sep 5, 2007 at 10:44 am
Same functionality was available in oracle forms for long time, good to see Oracle adding same (no exactly) at Database level!
2 Rajender Singh // Sep 18, 2007 at 3:30 pm
I agree with you!
Leave a Comment