QUESTION POSED ON: 08 January 2002
I have a database file which has some audit fields on it: add date and
time, and update date and time (all numeric fields). I wish to update these fields with the current date and time whenever the database has a record updated or inserted. I also want to add a unique identifier sequence number into any inserted record.
I've written a trigger to do this, and I am simply putting the date, time and sequence number into the new record image in the trigger buffer. The trigger is written in RPGLE under V4R5, with ACTGRP(*CALLER) and DFTACTGRP(*NO).
The trigger is added to the PF for after insert and after update, with ALWREPCHG(*YES).
When the file is changed through DFU or SQL, the trigger works fine. When the file is changed by an RPG/III program, the calling program fails with a "pointer reference not set" error at the UPDATE or WRITE statement. Why is this? What am I missing?
|