Sure, you can use a trigger.


The trick is to use a before update (and add?) trigger and update the "after
image" buffer passed into your trigger.

***you can't do normal I/O from the trigger to the file the trigger is
attached to.  You must update the buffer passed to your trigger.

Also, you need to define your trigger with ALWREPCHG(*YES).


HTH,
Charles


> -----Original Message-----
> From: Smith, Mike [mailto:Mike_Smith@xxxxxxxxxxxxxxxx]
> Sent: Tuesday, October 26, 2004 4:01 PM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: Trigger?
> 
> 
> We have a situation were I need to add a trigger to a file to 
> circumvent
> a problem.  We should really fix the bug, but this is a temporary
> situation so it has been decided to try this approach
> .  
> We have a file that in certain situations is updating a field, as a
> result of this field being populated, other processes are being
> affected.  
> So the idea was when a record is inserted to have the trigger program
> CLEAR this field.  I have tried to accomplish this directly in the
> trigger program(both before and after the insert) and also, 
> in a called
> program from the trigger.  
> 
> Does this sound like I can accomplish this in the trigger.  
> If so, what
> should the approach be. 
> 
> Michael Smith
> iSeries.mySeries.
> 
> --
> 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.