On DB2 V9 for z/OS, I am attempting to create the trigger below but receive the following error:
SQLState: 56059
ErrorCode: -20100
Is the trigger failing because SP02_ADDRESS_TYPE is not an updated field on the table?
Any help would be great. Thank you in advance.
CREATE TRIGGER DB.TRSP02UPD
AFTER UPDATE OF SP02_ADDRESS_LINE_1,
SP02_ADDRESS_LINE_2,
SP02_CITY,
SP02_ZIPCODE,
SP02_ZIP_PLUS4
ON DB.SP02_ADDRESS_T
REFERENCING NEW AS NEWV
OLD AS PREV
FOR EACH ROW MODE DB2SQL
WHEN (SP02_ADDRESS_TYPE = 3)
CALL DB.SP02UPD (PREV.SP02_ADDRESS_ID,
NEWV.SP02_ADDRESS_LINE_1,
NEWV.SP02_ADDRESS_LINE_2,
NEWV.SP02_CITY,
NEWV.SP02_ZIPCODE,
NEWV.SP02_ZIP_PLUS4);
COMMIT;