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: Database trigger on AFTER UPDATE with Procedure Bldr.

Re: Database trigger on AFTER UPDATE with Procedure Bldr.

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Sun, 27 Dec 1998 14:53:55 GMT
Message-ID: <01be31a7$8c9dbdc0$LocalHost@viao1.camk.com>


The mutating table message shows that you are trying to query a table value which is/may be currently being modified, in this case the :old value. It *may* work if you referred to the :new value - I forget the exact conditions for mutation and I'm almost surprised that you are getting a mutation problem... unless entry_id is being updated?

As far as I can see, your code should look something like:

BEGIN

	SELECT descrip2
	INTO :new.descrip1
	FROM table2
	WHERE (table2.entry_id = :new.entry_id)
	;

END; Andy
bdickey_at_my-dejanews.com wrote in article <763pvj$9cb$1_at_nnrp1.dejanews.com>...
> In article <01be3072$0cff1040$LocalHost_at_viao1.camk.com>,
> "Andy Hardy" <aph_at_ahardy.demon.co.uk> wrote:
> > Sounds like your query to the second table is bringing back more than
one
> > row of data - your code excerpt doesn't seem to include a where clause.
> >
> > Also, if you are just trying to replace a column value as the row is
> > inserted/updated you should be doing something like ':new.col1 :=
> > my_replacement_value' - you seem to be trying to insert a new row into
> > table1??
> >
> > Andy
> >
> I tried a WHERE clause to limit the select statement to a single row
> (Where table2.entry_id = :old.table1.entry_id) however, that gives me an
error
> message that table1 is mutating, and does not complete the update.
Thanks.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

>
Received on Sun Dec 27 1998 - 08:53:55 CST

Original text of this message

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