Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table is mutating, trigger/function may not see it

Status
Not open for further replies.

kvang

Programmer
Oct 7, 2005
129
US
I have a lookup table that I want to update with the following query:

Code:
UPDATE VARIABLE_BACKLOG SET 
LASTCUTOFF = Get_Last_Cutoff_Date(WORKTYPE, SYSDATE),
NEXTCUTOFF = Get_Next_Cutoff_Date(WORKTYPE, SYSDATE),
CAPTURETIME = SYSDATE

Get_Last_Cutoff_Date and Get_Next_Cutoff_Date are custom functions. When I first created this table, I had no problem executing this script. I have no triggers on this table I am trying to update. Any help is appreciated.

My table schema:
Code:
CREATE TABLE VARIABLE_BACKLOG
(
  WORKTYPE       VARCHAR2(50 BYTE),
  DEPTINT        VARCHAR2(10 BYTE),
  DAYOFWEEK      INTEGER,
  MONTHEND       INTEGER,
  DAYS_TO_SUBTR  NUMBER,
  HRS_TO_SUBTR   NUMBER,
  LASTCUTOFF     DATE,
  NEXTCUTOFF     DATE,
  CAPTURETIME    DATE
)
 
Oh yeah, I am getting the following error:

ORA-04091: table LSAPP.VARIABLE_BACKLOG is mutating, trigger/function may not see it
ORA-06512: at "LSAPP.GET_LAST_CUTOFF_DATE", line 23
 
Nevermind, I was calling the same table I was trying to update in the function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top