Re: Database triggers

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 30 Sep 1999 09:46:24 -0400
Message-ID: <F2nzN0vkAgicFvrRrXXCFNz2t02L_at_4ax.com>


A copy of this was sent to "Karim" <kmub_at_dds.nl> (if that email address didn't require changing) On Thu, 30 Sep 1999 15:30:21 +0200, you wrote:

>Hi
>
>I create two after insert on the same table for each row, It is very
>important for me to know the sequence of the execution of the triggers.
>Any experience, idea
>

it is not defined. the order can be any order it feels like doing.

if you need processing in your AFTER, FOR EACH ROW trigger to be performed in some prescribed order, you must use 2 procedures then called from 1 trigger -- NOT 2 triggers called in some random order.

Eg: instead of coding:

create trigger t1 after insert on T for each row begin
  .... process 1 .....
end;

create trigger t2 after insert on T for each row begin
  .... process 2 ....
end;

you would code:

create procedure process1(...)
as ...

create procedure process2( .... )
as ...

create trigger t_both after insert on t for each row begin

   process1();
   process2();
end;
/

>Kareem
>Kmubarak_at_dstm.nl
>
>

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
[Quoted] Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
[Quoted] Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Thu Sep 30 1999 - 15:46:24 CEST

Original text of this message