× 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.



Read triggers are activated from the QDBGET* variants. Insert triggers by QDBPUT* variants. Update & Delete triggers by QDBUDR. Each of these programs, in library QSYS. All SQL I/O is limited in what database engine programs [QDBxxx*] will be seen in the stack, but RLA I/O could activate from any of those three prefixes. Be aware however, that PTFed database I/O programs, which prior to some v5r? were always *DELAYED apply, since PTFs to these programs may now be applied *IMMED, these programs may not have the QDBXXX name prefix and library name QSYS in the instant that a PTF is being applied or removed.

If the program of interest needs to be the recipient of some messaging from the trigger program anyhow, and the failure of that program to be in the stack is a cause for the trigger action not to occur, then a message [e.g. completion or diagnostic] can be sent directly to the named-as-expected program. So if the named program is on the stack then the message will be sent to that program, but if the named program is not on the stack then the message send will fail with cpf24?? as an indication that the trigger action should not occur. With messaging [at least for system programs; I think for user programs too], even if the program is renamed and moved to QRPLOBJ, the message send should find the appropriate named-as-expected program, because the objects that are find in the stack to be in QRPLOBJ are all double-checked to see if their previous name was the named-as-expected.

Regards, Chuck

Birgitta Hauser wrote:

a trigger program is activated by the database manager. The database
manager calls either the program QDBPUT (for input triggers) or QDBUDR (for update insert delete and read triggers). You simply have
to go back in the call stack and determine the program that is
located before the trigger program. You may use the API QWVRCSTK to
retrieve the call stack or send a message to the program previous to
QDBPUT or QDBUDR and determine the sender <<SNIP>>

James Lampert wrote:
Is there an easy way, in a trigger program, to find out what
program initiated the change that tripped the trigger?

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.