|
My guess is that DFU is deleting the record and re-writing it. I don't know the internal workings of DFU, but you can write a quickie RPG program that changes the key and does an update, and see what happens. I'm confused when you say "when I change a record, the trigger fires and my program writes a record to a log file showing *after *update" - that implies that you don't write what was in the buffer before the update. One thing to check, when you added the *UPDATE trigger did you use TRGUPDCND(*ALWAYS) (the default)? I always (sic) change this parameter to *CHANGE - that way, just "looking" at the record without updating it will not force the trigger to fire. Francis Lapeyre IS Dept. Programmer/Analyst Stewart Enterprises, Inc. E-mail: flapeyre@xxxxxxxx -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Richard Sent: Monday, March 20, 2006 1:10 PM To: midrange-l@xxxxxxxxxxxx Subject: Trigger question I'm getting a little confused about triggers, and would appreciate a little help. I have written and activated a program to my test file as *AFTER *INSERT and *AFTER *UPDATE and *AFTER DELETE. To test I am using DFU ( no comments please!!) to change data. when I add a record, the trigger fires and my program writes a record to a log file showing *after *insert. when I change a record, the trigger fires and my program writes a record to a log file showing *after *update when I delete a record, the trigger fires and my program writes a record to a log file showing *after *delete -- all ok so far, no my problem when I change the "key" of a record, the trigger fires TWICE, and my program writes TWO records to a log file showing *after *update ????? WHY? Thanks, /dick rhenley@xxxxxxxxxxxxxxxx Richard Henley rhenley@xxxxxxxxxxxxxxxx Richard Henley, Programmer 256.532.3603 ITS - Room 619 Madison County Commission 100 North Side Square Huntsville, Alabama 35801 -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-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.