× 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 did not know they removed the link.
Just in short. A trigger is activated by the database manager through one of the following programs (QDBPUT - Insert Trigger or QDBUDR - Update, Delete and Read Triggers).
So you only have to retrieve the program in the callstack before the trigger programs.
The easiest way to do it, is using a CL-Program to which QDBPUT or QDBUDR.

Here is the CL-Program:
Pass QDBPUT or QDBUDR in the PARCALLED Parameter and the caller program is returned in the RTNCALLER Parameter
/* ***********************************************************************/
/* Objektname : PrvPgm */
/* Beschreibung : Determine the caller program */
/* Programmierer : B. Hauser */
/* Erstelldatum : 1999-07-01 */
/* Parameter : RtnCaller 10A = Caller Program (Output) */
/* ParCalled 10A = Called Program (Eingabe-Wert) */
/* ***********************************************************************/
PGM PARM(&RtnCaller &ParCALLED)
/* -----------------------------------------------------------------*/
/* Definieren Variable */
/* -----------------------------------------------------------------*/
/* Parameter-Felder */
DCL VAR(&RTNCALLER) TYPE(*CHAR) LEN(10)
DCL VAR(&PARCALLED) TYPE(*CHAR) LEN(10)

DCL VAR(&MSGKEY) TYPE(*CHAR) LEN(4)
DCL VAR(&SENDER) TYPE(*CHAR) LEN(80)

/* -----------------------------------------------------------------*/
/* Ermitteln rufendes Programm */
/* -----------------------------------------------------------------*/
SNDPGMMSG MSG('TEST') TOPGMQ(*PRV (&ParCALLED)) +
MSGTYPE(*RQS) KEYVAR(&MSGKEY)

RCVMSG PGMQ(*PRV (&ParCALLED)) MSGKEY(&MSGKEY) +
SENDER(&SENDER)

CHGVAR VAR(&RtnCaller) +
VALUE(%SST(&SENDER 56 10))

/* -----------------------------------------------------------------*/
/* PROGRAMM-ENDE */
/* -----------------------------------------------------------------*/
ENDE: ENDPGM

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"
„Train people well enough so they can leave, treat them well enough so they don't want to.“ (Richard Branson)


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Rob Berendt
Sent: Donnerstag, 1. Februar 2018 13:09
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: RE: Information available when a db2 trigger fires off/calls an rpg program.

Birgitta,
I tried your link,
http://www.code400.com/forum/forum/iseries-programming-languages/sql/1759-sql-trigger
Then I tried the link "Who fired my trigger oder Welches Programm aktivierte meinen Trigger"
All that got me to was a search ads site:
http://ww38.inn-online.de/iNN-eNews0412.html#Tekki3


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: "Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx>
To: "'Midrange Systems Technical Discussion'"
<midrange-l@xxxxxxxxxxxx>
Date: 02/01/2018 01:23 AM
Subject: RE: Information available when a db2 trigger fires
off/calls an rpg program.
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



Please check the following link:
http://www.code400.com/forum/forum/iseries-programming-languages/sql/1759-sq

l-trigger

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
„Train people well enough so they can leave, treat them well enough so
they
don't want to.“ (Richard Branson)


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
JRusling@xxxxxxxxxxx
Sent: Mittwoch, 31. Januar 2018 20:50
To: midrange-l <midrange-l@xxxxxxxxxxxx>
Subject: Information available when a db2 trigger fires off/calls an rpg
program.

When a process/program updates a file and causes the trigger to fire which
then calls an rpg program --

1. Is the process/program that updated the file available to the rpg
program? (ie DBU, STRSQL, RUNSQLSTM or another program)

2. Is the user id which the process/program is running under available to
the rpg program?
(I am assuming yes via the pgm status data structure)

Thanks for any help, tips or direction.

John
<br />
The information in this email is confidential and may be legally
privileged.
It is intended solely for the addressee. Access to this email by anyone
else
is unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in
reliance
on it, is prohibited and may be unlawful.
--
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: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
http://amzn.to/2dEadiD


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.