Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Execute a row level trigger before a Statement level trigger

KevinFitzNov 5 2014 — edited Nov 6 2014

Hi,

I'm trying to ensure that a row level trigger fires before a statement level trigger ( the other way round seems to be the default!). Initially I tried to use the FOLLOWS Clause in the statement level trigger, unfortunately this gave rise to the following error message:

Error: ORA-25022: cannot reference a trigger of a different type

I then tried to solve that problem by using 2 compound triggers with the FOLLOWS clause in the trigger that I wanted to execute 'second':

CREATE TRIGGER trig1

FOR UPDATE

ON table1

COMPOUND TRIGGER

BEFORE EACH ROW IS

BEGIN

...

END BEFORE EACH ROW

END trig1;

CREATE TRIGGER trig2

FOR UPDATE ...

ON table1

FOLLOWS trig1

COMPOUND TRIGGER

BEFORE STATEMENT IS

BEGIN

...

...

END STATEMENT ;

END trig2;

Both triggers compiled but still do not execute in the order that I want them to. Does anyone have an explantion for this behaviour or a solution to get the triggers to execute in the order I want? I am using Oracle 11g

regards,

Kevin.

This post has been answered by Dave Rabone on Nov 6 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2014
Added on Nov 5 2014
12 comments
2,892 views