DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: problem with trigger mutation

Threaded View

  1. #1
    Join Date
    Jan 2003
    Location
    india
    Posts
    175

    problem with trigger mutation

    hi,

    i have a table t1 with columns c1 and c2.

    i need to set the value of c2 based on the value of c1.
    so many applications are updating the column c1.
    the column c2 is newly added for some other applications.
    i can not modify all the old applications to update c2.

    i have a trigger on the table to update
    the column c2 if the value of column c1
    is changed.

    when i tried to update the column c1
    i am getting the error

    " ORA-04091 table string.string is mutating,
    trigger/function may not see it "

    copy of the trigger is

    create or replace trigger UpdateExpectedStock
    after insert or update on DrugControl
    referencing old as O new as N
    for each row
    begin

    update drugcontrol set ExpectedStock=
    ExpectedStock-(O.BalanceDrug - N.BalanceDrug)
    where Deptcode=O.DeptCode
    and TradeCode=O.TradeCode;
    end;


    can any body help to solve this problem.


    thanks in advance
    Raja
    Last edited by rajabalachandra; 09-11-2003 at 12:11 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width