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: After Update Trigger

Re: After Update Trigger

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 20 Nov 2006 08:56:08 -0800
Message-ID: <1164041768.326353@bubbleator.drizzle.com>


Mikail Dellovich wrote:
> DA Morgan wrote:

>> Mikail Dellovich wrote:
>>> How may I setup a trigger  on a table being updated to update another 
>>> table based on the current table being updated with out getting the 
>>> mutating table error. Is there a non row after update trigger for the 
>>> whole table the triggers after all the rows are updated?
>>>
>>> Thanks
>>
>> By posting your database version (the rules are version specific)
>> By posting your trigger code so we can see what you are trying to do
>> By posting the actual error message you are receiving

>
> Database: 10gr2
>
> I will give you an example:
>
> table a
> (
> col1 varchar2(20),
> col2 number(20)
> )
>
> table b
> (
> col1 varchar2(20),
> col2 number(20)
> )
>
> procedure a(lvcol)
> {
>
> select sum(col2) into lvsum from table a where col1=lvcol;
>
> update table b col2=lvsum where col1=lvcol;
> }
>
>
> I want to call procedure a everytime table a is updated or inserted.
>
> Thanks

1/2 way there but you still haven't posted the code causing the error. Without that all we can do is guess as to what you are doing wrong.

But as generic advice, which might well be bad advice given I still don't know what you are doing, make the procedure an AUTONOMOUS TRANSACTION.

Demo in Morgan's Library at www.psoug.org.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Mon Nov 20 2006 - 10:56:08 CST

Original text of this message

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