Thanks to all that responded.  I had been trying the *before, however, I
wasn't aware of the ALWREPCHG(*YES) parm.  

Michael Smith
iSeries.mySeries.


-----Original Message-----
From: Douglas Handy [mailto:dhandy@xxxxxxxxx] 
Sent: Tuesday, October 26, 2004 4:15 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Trigger?


Michael,

> So the idea was when a record is inserted to have the trigger program 
> CLEAR this field.

You can do this, but *only* if you use a *BEFORE trigger with
ALWREPCHG(*YES) to allow repeating changes (ie, changes to the buffer
itself).

By the time a *AFTER trigger is called, it is too late to have an
effect.  And the requirement to code ALWREPCHG(*YES) on the ADDPFTRG (or
CHGPFTRG) ensures you only do this when you really intend to have buffer
changes affect the underlying file.

Doug
--
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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.