If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > table %s.%s is mutating, trigger/function may not see it errors

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Sep 2012
Posts: 9
table %s.%s is mutating, trigger/function may not see it errors

Greetings all,

It has been a long time since I have used Oracle and PL-SQL. I created a reference table with a single varchar(10) PRIMARY KEY. There are other 2 datetime fields populated with SYSDATE values. I am trying to delete a record based a certain primary key value below.

delete from SERVERLIST
where SERVER_ID = 'F11'

and I am getting this error message:

Error starting at line 1 in command:
delete from SERVERLIST
where SERVER_ID = 'F11'
Error report:
SQL Error: ORA-04091: table APSOM.PROCESS_STATUS is mutating, trigger/function may not see it
ORA-06512: at "APSOM.TD_SERVERLIST", line 9
ORA-04088: error during execution of trigger 'APSOM.TD_SERVERLIST'
04091. 00000 - "table %s.%s is mutating, trigger/function may not see it"
*Cause: A trigger (or a user defined plsql function that is referenced in
this statement) attempted to look at (or modify) a table that was
in the middle of being modified by the statement which fired it.
*Action: Rewrite the trigger (or function) so it does not read that table.

I saw online that this sort of issue relates to deletions of records with datetime fields, but I was unclear as to how to resolve this issue. Any help would be greatly appreciated.

Patrick Quinn
Operations
Turning Point Global Solutions

Last edited by gikyo12; 09-18-12 at 10:51. Reason: Forgot to include autosignature
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Jun 2004
Posts: 733
Have you searched for an answer on this forum? There's 180 finds for "trigger mutating".
__________________
90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 7,571
you can avoid Mutating Trigger error by not doing SQL in a trigger against same table upon which trigger is based.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Don't say, show. Don't promise, prove.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On