Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Please help me I'm mutating and I don't even know it!
I'm at my wits end..
I have a trigger which works fine before insertion, but fails with the
following error on update:
ERROR at line 1:
ORA-04091: table TEAMING.PHASE is mutating, trigger/function may not see
it
ORA-06512: at line 4
ORA-04088: error during execution of trigger
'TEAMING.PHASE_UNIQUE_CHECK_AND_ID_GEN'
Cutting down the trigger to it's simplest point where I still get the
problem, it looks like:
SQL> create or replace trigger phase_unique_check_and_id_gen
2 before insert or update on phase for each row
3 declare found number;
4 id number;
5 begin
6 select count (*) into found
7 from phase where (
8 :new.release = phase.release);
9 end;
10 /
On a table that looks like:
SQL> descri phase
Name Null? Type ------------------------------- -------- ---- PHASE_ID NOT NULL NUMBER RELEASE VARCHAR2(8) MILESTONE VARCHAR2(16) ACTIVITY VARCHAR2(16) EXEC_TYPE CHAR(1) STATUS CHAR(1) DESCRIPTION VARCHAR2(256) MARK_FOR_DELETE CHAR(1)
Can someone please show me the error of my ways? Help Mr. Wizard.. I don't want to be a mutant!!
Thanks Symen BlumenfeldReceived on Fri Feb 19 1999 - 08:27:44 CST
![]() |
![]() |