Hello,
Can any one help me in creating a trigger to update system date into a table while inserting a record into that table. I tried it like this, it is showing error !!!
The following error has occurred:
ORA-04091: table ACG.CENTREMST is mutating, trigger/function may not see it
ORA-06512: at "ACG.CENTREMST_ INSERT", line 5
ORA-04088: error during execution of trigger 'ACG.CENTREMST_ INSERT'
The TRIGGER I created like this....
CREATE OR REPLACE TRIGGER CentreMst_inser t
AFTER INSERT on Centremst FOR EACH ROW
DECLARE
vStmt VARCHAR2(200);
CKEY VARCHAR2(15);
BEGIN
SELECT :new.cocode||TO _CHAR(:new.Cent reType)||:new.C entrecode INTO CKEY FROM CENTREMST;
vStmt := 'Update CentreMst Set CreatedDt = SysDate Where Cocode||CENTRET YPE||CentreCode ='||CKEY;
EXECUTE IMMEDIATE vStmt ;
END;
Regards
Reshmi
Can any one help me in creating a trigger to update system date into a table while inserting a record into that table. I tried it like this, it is showing error !!!
The following error has occurred:
ORA-04091: table ACG.CENTREMST is mutating, trigger/function may not see it
ORA-06512: at "ACG.CENTREMST_ INSERT", line 5
ORA-04088: error during execution of trigger 'ACG.CENTREMST_ INSERT'
The TRIGGER I created like this....
CREATE OR REPLACE TRIGGER CentreMst_inser t
AFTER INSERT on Centremst FOR EACH ROW
DECLARE
vStmt VARCHAR2(200);
CKEY VARCHAR2(15);
BEGIN
SELECT :new.cocode||TO _CHAR(:new.Cent reType)||:new.C entrecode INTO CKEY FROM CENTREMST;
vStmt := 'Update CentreMst Set CreatedDt = SysDate Where Cocode||CENTRET YPE||CentreCode ='||CKEY;
EXECUTE IMMEDIATE vStmt ;
END;
Regards
Reshmi
Comment