MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » May 2014

Re: Update a field in a file from the trigger on the same file



fixed

A trigger is not a bad idea...

While there will be overhead for the trigger call, there would be no extra
I/O.

Make sure that you use a before update trigger that modifies the value in
the after buffer instead of trying to re-read the record explicitly.

You'll also need ALWREPCHG(*YES) on the tigger.

Charles


On Fri, May 30, 2014 at 11:15 AM, Jeff Young <jyoung0950@xxxxxxxxx> wrote:

All,
I have a file that I want to monitor for a change to a specific field.
If this field becomes negative, I want to set it to zero.

The file is updated by many programs and is my inventory master, so there
are a large number of transactions all day.

Is a trigger the best way to do this?
If not, what would be the best method with the least impact on performance?
If so, what is the impact on performance?


The system is at release V7R1M0 L00 TL12115


Jeff Young
Sr. Programmer Analyst
--
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.







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact