I found the following example of a delete trigger:
Why are they using N_ROW instead of O_ROW. I would expect O_ROW to contain the data before the delete, and N_ROW to contain the data after the delete which would be nil.
So I guess my real question is what do the old and new records refer to in a delete trigger.
Code:
CREATE TRIGGER D_TRANSLOGGER
AFTER DELETE OF TRIGTEST/ATMTXN
REFERENCING OLD AS O_ROW NEW AS N_ROW
FOR EACH ROW MODE DB2SQL
INSERT INTO TRIGTEST/ATMTXNLOG
VALUES (
'D', DATE(CURRENT TIMESTAMP), TIME(CURRENT TIMESTAMP),
CHAR(N_ROW.ATMID) || CHAR(N_ROW.ACCTID)|| CHAR(N_ROW.TCODE)||
CHAR(N_ROW.AMOUNT) || CHAR(N_ROW.DESC),
'DUMMY',
CHAR(ATMID)||CHAR(ACCTID)|| CHAR(TCODE)||
CHAR(AMOUNT)|| CHAR(DESC),
'DUMMY' )
So I guess my real question is what do the old and new records refer to in a delete trigger.