Home » SQL & PL/SQL » SQL & PL/SQL » ora-04091:table user.table1 is mutating,trigger function may not see (8.0.5 with form 60)  () 1 Vote
ora-04091:table user.table1 is mutating,trigger function may not see [message #298830] Thu, 07 February 2008 22:56 Go to next message
orarep
Messages: 56
Registered: September 2007
Member
hello

i have written the following databse triggers on a table STUDENT in oracle 8.1.7 and works fine but the same trigger do not work in oracle 8.0.5 and give an error
ora-04091:table user.STUDENT is mutating,trigger function may not see.

Triggers a are:

Create or replace trigger trig123 AFTER INSERT ON user.STUDENT REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW
BEGIN
insert into student_exam (no,course,term,disp) values (:new.no,:new.course,:new.term,'NIL');

END;

Create or replace trigger Trig223 AFTER update ON user.STUDENT REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW
BEGIN

update student_exam set no=:new.no,course=:new.course,term=:new.term
where student_exam.no=:old.no;

end;


so when i insert data in student table so the same data should also go to student_exam but it 's not working in boyh triggers and it works well in oracle 8.1.7


please any one can guide

regards
Re: ora-04091:table user.table1 is mutating,trigger function may not see [message #298832 is a reply to message #298830] Thu, 07 February 2008 23:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ Check if there is no trigger on student_exam
2/ Something that works is higher version may not work in lower one.

In addition, please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code.
Use the "Preview Message" button to verify.

Regards
Michel
Re: ora-04091:table user.table1 is mutating,trigger function may not see [message #298842 is a reply to message #298832] Fri, 08 February 2008 00:18 Go to previous messageGo to next message
orarep
Messages: 56
Registered: September 2007
Member
hello

i will try to stick with the writing post rules.

There is a trigger on student_exam and if these triggers do not work in oracle 8.0.5 so the how can i acheive my goal.

regards
Re: ora-04091:table user.table1 is mutating,trigger function may not see [message #298850 is a reply to message #298830] Fri, 08 February 2008 00:33 Go to previous messageGo to next message
mshrkshl
Messages: 247
Registered: September 2006
Location: New Delhi
Senior Member
use this link to solve your problem.

http://asktom.oracle.com/tkyte/Mutate/index.html


regards,
Re: ora-04091:table user.table1 is mutating,trigger function may not see [message #298853 is a reply to message #298842] Fri, 08 February 2008 00:44 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Sorry my crystal ball is broken can you say us what is the trigger on student_exam?

And if this does not work as it then change to make it work.

Regards
Michel
Previous Topic: Merge Update - ORA 30926
Next Topic: How To display 2 rows in a single row
Goto Forum:
  


Current Time: Sun Dec 04 04:13:06 CST 2016

Total time taken to generate the page: 0.24497 seconds