rajabalachandra
09-10-2003, 11:41 PM
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
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