getting error "table table1 is mutating, trigger/function may no" on executing trigger [message #669038] |
Thu, 29 March 2018 17:57 |
|
gold14388
Messages: 4 Registered: March 2018
|
Junior Member |
|
|
I am getting an error on executing trigger please help me finding a solution to over come this error
create or replace
trigger trigger1 AFTER INSERT OR UPDATE ON table1
FOR EACH ROW
DECLARE
v_Key1 NUMBER;
v_Key2 NUMBER;
v_Key3 NUMBER;
v_Key4 NUMBER;
BEGIN
IF UPDATING THEN
IF NOT UPDATING ('column1') THEN
UPDATE table1 SET column1 = SYS_EXTRACT_UTC(SYSTIMESTAMP) WHERE EKey = :NEW.EKey;
SELECT w.key1, w.key2, u.key3
INTO v_Key1, v_Key2, v_Key3
FROM Work w LEFT JOIN "USER" u ON u.UserKey = w.UserKey
WHERE w.Key = :OLD.EKey;
END IF;
ELSE
-- Inserting... just set the last updated date
UPDATE table1 SET column1 = SYS_EXTRACT_UTC(SYSTIMESTAMP) WHERE EKey = :NEW.EKey;
END IF;
END;
|
|
|
|
|
|
|
|
|
|
|