Current Package Name

John Kliewe

Current Package Name

I want to write a trigger that will record the package name every time a certain table is updated.  I was hoping to find a special register that contains the name of the package currently executing, but I cannot find such a thing.

 

My trigger would look something like this :

Create Trigger upd_log after insert on Table01
insert into log_table(table_name,package,timestamp) values('TABLE01',current package name, current timestamp)

 

Any ideas on how to accomplish this ?  I'm in Db2 for z, Release 11

Chris Hoelscher

Current Package Name
(in response to John Kliewe)
Built-in session variables
DB2 provides several built-in session variables that contain information about the
server and application process. The value of a built-in session variable can be
obtained by invoking the GETVARIABLE function with the name of the built-in
session variable.

SYSIBM.PACKAGE_NAME

Chris Hoelscher
Technology Architect, Database Infrastructure Services
Technology Solution Services
Humana Inc.
123 East Main Street
Louisville, KY 40202
Humana.com
(502) 476-2538 or 407-7266

From: John Kliewe <[login to unmask email]>
Sent: Friday, February 1, 2019 3:37 PM
To: [login to unmask email]
Subject: [DB2-L] - Current Package Name


I want to write a trigger that will record the package name every time a certain table is updated. I was hoping to find a special register that contains the name of the package currently executing, but I cannot find such a thing.



My trigger would look something like this :

Create Trigger upd_log after insert on Table01
insert into log_table(table_name,package,timestamp) values('TABLE01',current package name, current timestamp)



Any ideas on how to accomplish this ? I'm in Db2 for z, Release 11

-----End Original Message-----

The information transmitted is intended only for the person or entity to which it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information in error,
please contact the sender and delete or destroy the material/information.

Humana Inc. and its subsidiaries comply with applicable Federal civil rights laws and
do not discriminate on the basis of race, color, national origin, age, disability, sex,
sexual orientation, gender identity, or religion. Humana Inc. and its subsidiaries do not
exclude people or treat them differently because of race, color, national origin, age,
disability, sex, sexual orientation, gender identity, or religion.

English: ATTENTION: If you do not speak English, language assistance services, free
of charge, are available to you. Call 1‐877‐320‐1235 (TTY: 711).

Español (Spanish): ATENCIÓN: Si habla español, tiene a su disposición servicios
gratuitos de asistencia lingüística. Llame al 1‐877‐320‐1235 (TTY: 711).

繁體中文(Chinese):注意:如果您使用繁體中文,您可以免費獲得語言援助
服務。請致電 1‐877‐320‐1235 (TTY: 711)。

Kreyòl Ayisyen (Haitian Creole): ATANSION: Si w pale Kreyòl Ayisyen, gen sèvis èd
pou lang ki disponib gratis pou ou. Rele 1‐877‐320‐1235 (TTY: 711).

Polski (Polish): UWAGA: Jeżeli mówisz po polsku, możesz skorzystać z bezpłatnej
pomocy językowej. Zadzwoń pod numer 1‐877‐320‐1235 (TTY: 711).

한국어 (Korean): 주의: 한국어를 사용하시는 경우, 언어 지원 서비스를 무료로
이용하실 수 있습니다. 1‐877‐320‐1235 (TTY: 711)번으로 전화해 주십시오.

John Kliewe

RE: Current Package Name
(in response to Chris Hoelscher)

Perfect.

Thanks Chris!