Toad World® Forums

create trigger after an update and insert into Z table

Hi All i have an issue in creating this trigger in my Toad.

Below is my query

CREATE TRIGGER z_LOGIN2 AFTER UPDATE OF lastsignondttm ON SYSADM.PSOPRDEFN
FOR EACH ROW

BEGIN
SELECT DISTINCT a.oprid, a.oprdefndesc, a.lastsignondttm, b.rolename
from SYSADM.psoprdefn a, SYSADM.psroleuser b
where a.oprid=b.roleuser
and (rolename = ‘FAS Change Admin’ or b.rolename=‘PeopleSoft Administrator’)

INSERT INTO SYSADM.PS_FZAP_AUDIT_LOGS VALUES (a.oprid,a.oprdefndesc,a.lastsignondttm,‘test’,‘FS9DEVP’,user,sysdate);