DB2 for z/OS V8: Capture package name in Trigger

Chris Worthington

DB2 for z/OS V8: Capture package name in Trigger
I'm looking for a programmatic way to identify/capture the name of the
package that caused a trigger to fire. I didn't see anything in the list of special
registers that looked like it would help (maybe I missed something)?

Thanks in advance!

IMPORTANT NOTICE:

IDUG is pleased to announce a series of upgrades to the DB2-L discussion listserv that are being implemented to improve reliability and the overall user experience of DB2-L. These changes are coming on November 30th. Details at http://www.idug.org

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Suresh Sane

Re: DB2 for z/OS V8: Capture package name in Trigger
(in response to Chris Worthington)

Chris,

You may want to explore the GETVARIABLE function. As I recall, you can get the plan name that caused it to fire. There is a variable to get the package name but it returns the name of the trigger package (you already know THAT...). Some help.. may not be what you need.


GETVARIABLE('SYSIBM.PLAN_NAME') etc.

Please post the results (hopefully confirming my memory).

Thx
Suresh> Date: Thu, 29 Nov 2007 15:43:25 -0500> From: [login to unmask email]> Subject: [DB2-L] DB2 for z/OS V8: Capture package name in Trigger> To: [login to unmask email]> > I'm looking for a programmatic way to identify/capture the name of the > package that caused a trigger to fire. I didn't see anything in the list of special > registers that looked like it would help (maybe I missed something)?> > Thanks in advance!> > IMPORTANT NOTICE:> > IDUG is pleased to announce a series of upgrades to the DB2-L discussion listserv that are being implemented to improve reliability and the overall user experience of DB2-L. These changes are coming on November 30th. Details at http://www.idug.org> > ---------------------------------------------------------------------------------> Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm
_________________________________________________________________
You keep typing, we keep giving. Download Messenger and join the i’m Initiative now.
http://im.live.com/messenger/im/home/?source=TAGLM
IMPORTANT NOTICE:

IDUG is pleased to announce a series of upgrades to the DB2-L discussion listserv that are being implemented to improve reliability and the overall user experience of DB2-L. These changes are coming on November 30th. Details at http://www.idug.org

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Chris Worthington

Re: DB2 for z/OS V8: Capture package name in Trigger
(in response to Suresh Sane)
Suresh,

Good memory...it worked like a charm.
Thanks for your help!

CREATE TRIGGER XXXXXX.ABCDEFG
NO CASCADE
BEFORE UPDATE
ON XXXXXX.ABCDEFG
REFERENCING
NEW AS UPDROW
FOR EACH ROW
MODE DB2SQL
SET UPDATE_PGM_ID
= GETVARIABLE('SYSIBM.PLAN_NAME')
;

Regards,
Chris.

IMPORTANT NOTICE:

IDUG is pleased to announce a series of upgrades to the DB2-L discussion listserv that are being implemented to improve reliability and the overall user experience of DB2-L. These changes are coming on December 7th. Details at http://www.idug.org

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm