|
You say you are updating recordS, more than one. Okay, what you would probably want to do then is in your trigger program retrieve the name of the program that caused the trigger to fire (search the archives for this). Then, if it is your trigger program that caused the trigger to fire, just do a return. If, however, you are simply modifying the same record that caused the trigger to be fired in the first place, change it to a *BEFORE *UPDATE and modify the fields in your trigger before you return. The modified buffer will be written to disk and won't cause your trigger to call itself (check archives for details). Regards, Jim Langston Me transmitte sursum, Caledoni! jfinney@omnia.co.za wrote: > > Hi all, > > I've a problem with a trigger program. The trigger is *AFTER/*UPDATE and, > when fired, it needs to update records in the same file. How do I make sure > it does not call itself recursively (as I am currently receiving this error > message). > > Parms on ADDPFTRG CL cmd > > Physical file > > >---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > . . . . . . . . . > EWR > Library . . . . . . . . . . . *LIBL > Trigger time . . . . . . . . . . > *AFTER > Trigger event . . . . . . . . . > *UPDATE > Program . . . . . . . . . . . . > T_EWRR01 > Library . . . . . . . . . . . *LIBL > Replace trigger . . . . . . . . > *YES > Allow Repeated Change . . . . . > *YES > Threadsafe . . . . . . . . . . . *UNKNOW > Multithreaded job action . . . . *SYSVAL > Trigger update condition . . . . > *CHANGE > > Regards > John. -- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-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.
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.