Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Mutating Trigger??

Re: Mutating Trigger??

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 04 Dec 1998 04:10:39 GMT
Message-ID: <366e607e.4899114@192.86.155.100>


A copy of this was sent to Ed Bruce <Ed.Bruce_at_ha.hac.com> (if that email address didn't require changing) On Thu, 03 Dec 1998 14:56:39 -0600, you wrote:

>Thomas Kyte wrote:
>| create or replace trigger emp_bd
>| before delete on emp
>| begin
>| emp_pkg.empnos := emp_pkg.empty;
>| end;
>| /
>|
>| create or replace trigger emp_adfer
>| after delete on emp for each row
>| begin
>| emp_pkg.empnos( emp_pkg.empnos.count+1 ) := :old.mgr;
>| emp_pkg.enames( emp_pkg.empnos.count ) := :old.ename;
>| end;
>| /
>
>What if two or more transactions are started that delete rows from the
>emp table. And that these transactions are started very close to the
>same time. Would not trigger emp_bd be executed once for each delete.
>And couldn't/wouldn't this interfere with the emp_adfer trigger's logic?
>
>later,
>Ed

Nope, Oracle executes pl/sql like an OS executes code. Each session will share code (text) but has its own stack and data segments. the pl/sql package variable states are visible only to the owning session. Pl/sql package variables are session specific -- you cannot see my values, i cannot see yours.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Dec 03 1998 - 22:10:39 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US