Why is my trigger program failing? It's a CL program and it appears it is not even getting to the early part of the program where I have a halt to check job attributes. I created a physical file on our iSeries and added a trigger using the following command.
ADDPFTRG FILE(EXTRANET/WCTLH) TRGTIME(*AFTER) TRGEVENT(*INSERT) PGM(EXTRANET/WXTRAOE) TRGLIB(EXTRANET).
If you try adding data to the file using a DFU you get this
Message . . . . : EXIT DFU and SIGNOFF IMMEDIATELY. To allow data base roll back of data. CPF502B caused the problem. Cause . . . . . : A Referential Constraint Violation of Trigger program failure occurred during a PUT by DFU to the data base. Data changes will be rolled back once SIGNOFF from the current job is done. DO NOT CONTINUE to enter or change data as it will be rolled back as well once you signoff.
When we try adding data via an SQL or web application, we are getting error messages saying we need to turn journaling on.. We currently don't use journaling so why is it looking for it now?
The PF looks like this
A UNIQUE A R RF$WCH A WCHTIK 10S 0 TEXT('WEB TICKET') A WCHDIV 2A TEXT('DIVISION') A WCHWH 2A TEXT('WAREHOUSE') A WCHORD# 8S 0 TEXT('ORDER #') A WCHSTAT 15A TEXT('STATUS') A WCHTYPE 4A TEXT('LIVE/TEST') A WCHIDTE L TEXT('IN DATE') A WCHITIME T TEXT('IN TIME') A WCHITMST Z TEXT('IN TIMESTAMP') A WCHPDTE L TEXT('PROCESS DATE') A WCHPTIME T TEXT('PROCESS TIME') A WCHPTMST Z TEXT('PROCESS TIMESTAMP') A WCHWRK1 1A TEXT('WORK FLG1') A WCHWRK2 1A TEXT('WORK FLG2') A WCHWRK3 1A TEXT('WORK FLG3') A WCHPGMV 5S 2 TEXT('PROGRAM VER.') A K WCHTIK
V5R4M5 on an iSeries
March 31, 2010 6:20 PM
April 1, 2010 10:30 PM