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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Mutating Table error - AFTER INSERT/UPDATE trigger

Re: Mutating Table error - AFTER INSERT/UPDATE trigger

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 24 Feb 2004 13:43:25 -0800
Message-ID: <1077658965.803871@yasure>


M Mueller wrote:

> Hello -
>
> I believe I posted this in the wrong ng before - sorry for the double
> post (if you noticed the other message).
>
> I'm using Oracle 8.1.7 and am running into the infamous mutating table
> error on an AFTER INSERT OR UPDATE FOR EACH ROW trigger. I have seen
> examples for getting around mutating table errors if you either need
> access to the :old or the :new values within a trigger. But what if
> you need access to both? Or is this even possible (I'm fairly new to
> triggers).

The mutating error has nothing to do with :OLD and/or :NEW. It has to do with putting a trigger on table_a that references table_a as you have done.

> ON table_a

> select count(*) into numofdocs from table_a

> Thanks so much,
> Melissa

You can't do that. And if you think you need to I'd suggest you sit down with a senior DBA or architect at your place of work and have them help you redesign what you are doing.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Feb 24 2004 - 15:43:25 CST

Original text of this message

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