|
I don't see it on ADDPFTRG but I think with SQL triggers you can tell it to fire off only if certain fields get changed. Saw this in the October 2001 edition of iSeries News in an article by Kent Milligan "Uncovering V5R1 Triggers". Rob Berendt -- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." Benjamin Franklin Dave Murvin <davem@xxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 09/04/2003 08:55 AM Please respond to RPG programming on the AS400 / iSeries To: rpg400-l@xxxxxxxxxxxx cc: Fax to: Subject: Comparing old/new fields in trigger program We will be creating several more trigger programs for some additional data files. Some of these files have hundreds of fields, but we are only interested in changes to a small subset of these fields. Is there a way to easily group the fields we are interested in into another data structure (besides the new/old record image) so we can determine if there was a change we are interested in by comparing two data structures versus checking every field we are interested in? Ideally the field values would be sucked into the data structures without having to code the moves. The fields we are interested in are spread throughout the filed and are not usually contiguous. I have tried additional data structures, but program will not compile because the fields are already defined in the old/new data structures. We are on V5R1. Snippet from existing trigger program follows: * Record detail for old record D OldRecordDS E DS ExtName(ECL) D Prefix(Old) D Based(OldRecordPtr) * Record detail for new record D NewRecordDS E DS ExtName(ECL) D Prefix(New) D Based(NewRecordPtr) C Eval OldRecordPtr = %Addr(TrigBuf) + OldRcdOff C Eval NewRecordPtr = %Addr(TrigBuf) + NewRcdOff Thanks for any suggestions. Dave Murvin DRM Enterprises, Inc. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.