Hi ,
I have created a trigger which i got help from this forum , but i get the below error.
Should i create any compount trigger to update my table.
Here is my trigger
CREATE OR REPLACE TRIGGER SYSADM.z_LOGIN2
AFTER UPDATE OF lastsignondttm
ON SYSADM.PSOPRDEFN
REFERENCING NEW AS New OLD AS Old
FOR EACH ROW
BEGIN
INSERT INTO SYSADM.PS_FZAP_AUDIT_SOX (oprid, oprdefndesc,lastsignondttm,
fzap_reason_cd,dbname,lastupdoprid,lastupddttm)
select distinct :new.oprid,:new.oprdefndesc,:new.lastsignondttm,’ ‘,’ ',:new.lastupddttm,:new.lastupdoprid
from sysadm.psroleuser b
where b.roleuser = :new.oprid
and (b.rolename = ‘FAS Change Admin’ or b.rolename=‘PeopleSoft Administrator’);
END;
Error Position: 0 Return: 4091 - ORA-04091: table SYSADM.PSOPRDEFN is mutating, trigger/function may not see it ORA-06512: at “SYSADM.Z_LOGIN3”, line 2 ORA-04088: error during execution of trigger ‘SYSADM.Z_LOGIN3’
Failed SQL stmt:UPDATE PSOPRDEFN SET LASTSIGNONDTTM = TO_TIMESTAMP(:1,‘YYYY-MM-DD-HH24.MI.SS.FF’) WHERE OPRID = :2