|
Brian, I'd rather not use the FIDS, but rely on an SQL count(*) to give me the current record count. AFAIK, the trigger program is called for each insert, and the next insert has to wait until the previous call to the trigger program is finished. In this case, you only need to delete the oldest record to keep your number of records under the limit. Of course, I could be wrong, as I haven't tested this. HTH, Peter Colpaert Application Developer PLI - IT - Kontich, Belgium ----- Yoda of Borg are we. Futile is resistance, assimilated will you be. ----- Brian Lewis <bsl04@xxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 26/10/2006 23:37 Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To rpg400-l@xxxxxxxxxxxx cc Subject Re: log file On Thu, 26 Oct 2006 15:34:33 +0200 Peter.Colpaert@xxxxxxxxx wrote:
You could write a trigger program to be executed when the record is added. Check the number of records currently in the file, and delete the oldest one if your limit is reached.
Do you know if the file information data structure will accurately reflect the number of records if used in a trigger program? I'm a little unsure about the exact behavior of trigger programs. If there is a before-insert trigger on a file, do subsequent adds have to wait for the trigger program to complete? I'm not sure whether the situation will ever arise that there are, say, 105 records in a file I intend to contain only 100. I'm trying to ask whether I need to code the trigger program to delete one record at the beginning if needed, or to code it so that it deletes numrecords - n at the beginning. Thanks for the help.
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.