Re: Mutating problem

From: Stephen G. Coleman <sgc_at_wks40hp.shell.com>
Date: 1995/03/29
Message-ID: <D681vs.7tq_at_shellgate.shell.com>#1/1


The manuals state that you cannot select from the table that is changing at the time.

I believe that stored procedures are executed on the server side, not the client side -- plus stored procedures are quicker to run than triggers since triggers are re-parsed (or whatever) each time they are invoked (I think). At the IOUG last year they talked about making your trigger code be as small as possible and simply calling stored procedures/packages.

I'm not sure your stored procedure can select from the mutating table. Try it and see.

In article <3kpo04$935_at_due.unit.no>, toredale_at_pvv.unit.no (Bj|rn Tore Dale) writes:
>> I have two tables A and B.
>> Table A has a field SUMWGT and STATUS and ARTICLE.
>> Table B has a field WGT and LINENO and ARTICLE.
>> I would like an Update/Delete Trigger on table B to
>> compute the SUM(WGT) for all rows,except the one being updated/deleted
>> with the given ARTICLE
>> (key on table A is ARTICLE, key on table B is ARTICLE+LINENO)
>> and Update the row on table A for this given article with
>> a new STATUS, which depend on the new sum.
>> The problem is that I get the Oracle error "Table is Mutating",
>> even if I make sure that the Where-clause doesn't select
>> the row that is being updated/deleted (the error does not, of course,
>> occur when inserting).
>>
>> Can anybody help me out on this one?
>> I don't want to call a stored procedure from the client-side to
>> perform the Update on table A. I would like to handle all this
>> in triggers.
>>
>> Bjorn T. Dale
>> toredale_at_flipper.pvv.unit.no
>>
>>
Received on Wed Mar 29 1995 - 00:00:00 CEST

Original text of this message