|
CREATE OR REPLACE TRIGGER trigger_insert
AFTER INSERT ON tableA
REFERENCING NEW AS newRow
FOR EACH ROW
BEGIN
INSERT INTO tableA_tri VALUES (:newRow.acc_no, to_char(sysdate, 'yyyymmdd'), to_char(sysdate, 'HH24:MI:SS'), 'INSERT', USERENV('TERMINAL'));
END;
/
CREATE OR REPLACE TRIGGER trigger_update
AFTER UPDATE ON tableA
REFERENCING NEW AS newRow
FOR EACH ROW
BEGIN
INSERT INTO tableA_tri VALUES (:newRow.acc_no, to_char(sysdate, 'yyyymmdd'), to_char(sysdate, 'HH24:MI:SS'), 'UPDATE', USERENV('TERMINAL'));
END;
/
CREATE OR REPLACE TRIGGER trigger_delete
AFTER DELETE ON tableA
FOR EACH ROW
BEGIN
INSERT INTO tableA_tri VALUES (ld.acc_no, to_char(sysdate, 'yyyymmdd'), to_char(sysdate, 'HH24:MI:SS'), 'DELETE', USERENV('TERMINAL'));
END;
/ |
|