×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Booth
At 06:11 PM 6/29/1998 -0400, you wrote:
>I'd like to do a simple trigger program. What I'd really like to do is to
>fill in a "timestamp" and a "updated by" field on a record anytime it is
>created or changed, regardless of where it is done. The physical file is
>in arrrival sequence and unindexed. It seemed simple enough - a
>ADDPFTRG after *UPDATE with a simple program that moved the SDS's User
>field, and a TIME command into the correct fields, and update.
>
>That was where I realized I was in trouble... how do I find the relative
>record number that was just processed so I can easily find the correct
>record? Or is that the wrong approach altogether?
I don't know if you need the RRN. The following bit from the section, "Trigger Program Coding Guidelines and Usages", from 'DB2 for AS/400 Database Programming', may apply:
>>>>
The Allow Repeated Change ALWREPCHG(*YES) parameter on the Add Physical File Trigger (ADDPFTRG) command also affects trigger programs defined to be called before insert and update database operations. If the trigger program updates the new record in the trigger buffer and ALWREPCHG(*YES) is specified, the modified new record image is used for the actual insert or update operation on the associated physical file. This option can be helpful in trigger programs that are designed for data validation and data correction. You should be aware that because the trigger program receives physical file record images (even for logical files), the trigger program is allowed to change any field of that record image.
<<<<
It looks like you want a 'before update' trigger.
HTH
Vernon Hamberg
Systems Software Programmer
Old Republic National Title Insurance Company
400 Second Avenue South
Minneapolis, MN 55401-2499
(612) 371-1111 x480
+--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.