× 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 am a huge proponent of the trigger solution to detect when records have
changed in the database.

 

It has the advantage of happening right away (synchronous with the change),
and you don't have some polling program waiting for EOFDLY to see if there
might be something else to be done.

 

To be a bit more explicit:

 

ADDPFTRG FILE(PHYFILE)               

          TRGTIME(*AFTER)           

          TRGEVENT(*INSERT)         

          PGM(MYPROGRAM)  

 

The statement above would only be fired if record ADDs occur (new records
coming INTO the file)

 

ADDPFTRG FILE(PHYFILE)                 

         TRGTIME(*AFTER)               

         TRGEVENT(*UPDATE)             

         PGM(MYPROGRAM)                

         TRGUPDCND(*CHANGE)            

                                       

The statement above would only be fired if a record were updated AND the
record contents changed, which addresses your concern about someone changing
some other existing record to be an 'OS' record.

(If a record update occurred and all the fields were the same, the program
would not bother calling MYPROGRAM. - Yes, I have see plenty of programs
that still do this. )

 

 

There are plenty of good examples of trigger programs floating around, in
case you some. 

Check out the infocenter as well for more details about triggers.

 

 

 

PS: Depending on file activity, strongly consider not leaving the program
with *INLR on (keeps program active). 

[There, THAT should generate some comments]

 

Gary Bowers

Information Technology

Charlotte, NC 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.