--trigger CREATE OR REPLACE TRIGGER USRNET.TRG_CB_ACTIVE_CODE_HIS AFTER UPDATE OR DELETE ON USRNET.tcb_activation_code FOR EACH ROW DECLARE V_ACTION VARCHAR2 (20); BEGIN IF INSERTING THEN V_ACTION := 'INSERTING'; ELSIF UPDATING THEN V_ACTION := 'UPDATING'; ELSIF DELETING THEN V_ACTION := 'DELETING'; END IF; INSERT INTO TCB_ACTIVATION_CODE_HIS ( CH_ACTION, CHANGEDT, CHANGETER, CHNGEUID, CODE, DBUSER, EXP_TIME, MODULENAME, PRODUCT, REGREF, SEND_DT, SEND_MEDIUM, SEND_STAUS, STATUS, SYSDT, USER_REF, USERTERM) VALUES ( V_ACTION , SYSDATE , SYS_CONTEXT ('USERENV', 'IP_ADDRESS') , USER, :OLD.CODE , :OLD.DBUSER , :OLD.EXP_TIME , :OLD.MODULENAME , :OLD.PRODUCT , :OLD.REGREF , :OLD.SEND_DT , :OLD.SEND_MEDIUM , :OLD.SEND_STAUS , :OLD.STATUS , :OLD.SYSDT , :OLD.USER_REF , :OLD.USERTERM ); EXCEPTION WHEN OTHERS THEN NULL; END; / SHOW ERRORS;