× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm new to trigger programs, so maybe this is very basic, but I haven't
been able to find any place that talks about this specific situation.

I have a file that has a numeric field that I want to use as a unique key
-- like an auto-increment field, but we're still at V5R1 :-(. I thought I
could do this with a trigger - simply set up a data area with the
last-used number, add the trigger program before the insert, and it could
read the data area, update the number, and put it in the field before the
record is stored.

This seemed simple enough, but I can't get it to work. I've got a trigger
program, and I know it's running because I can see it in debug. I know
it's finding the data area because the counter there is getting updated. I
can even see in debug that the (new image of the ) field in the file is
getting the new value. But it's not being stored in the file -- all the
new records are showing up with zeros.

Can this be done? If so, would someone give me a hint as to what I might
be doing wrong and/or point me to somewhere where I can learn more about
how this works?

Thanks very much!

Mike Naughton
Senior Programmer/Analyst
Judd Wire, Inc.
124 Turnpike Road
Turners Falls, MA  01376
413-863-4357 x444
mnaughton@xxxxxxxxxxxx



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.