IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Log an Plan name/id or Job Id using DB2 Triggers


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SENTHIL MURUGAAN
Warnings : 1

New User


Joined: 12 Jan 2013
Posts: 32
Location: India

PostPosted: Mon Oct 22, 2018 4:17 pm
Reply with quote

Hello All,

We have created a DB2 Triggers to log all the deletion action on each rows from X table.
[CREATE TRIGGER TST.GX
AFTER DELETE ON TST.X
REFERENCING OLD AS O
FOR EACH ROW MODE DB2SQL
INSERT INTO TST.XD
( ID_X,
DELETEBY,
DELETEDT,
DELETEHMS)
VALUES
( O.ID_X,
SESSION_USER,
CURRENT DATE,
CURRENT TIME)]

But when we tried to delete rows from table X thru both SPUFI (Manual) and BATCH job execution, we could see both entries "SESSION_USER" values are same as developer id.

Kindly please advise how to store an either PLAN NAME/JOB NAME value in log table to trace the deletion log done by either user or application batch?

Thanks
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Dec 28, 2018 8:17 pm
Reply with quote

Its late reply and you might have already found the cause but if not then did you follow these while creating XD table ( pay attention to BOLD letters ?
Scenario for tracking auditing information
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts current batch plan DB2 3
No new posts Usage/Utiliy of Plan in DB2 DB2 4
No new posts How do I define a DB2 plan for a web ... CICS 5
No new posts CICS web service from DB2 Triggers or... DB2 2
No new posts Finding the plan when code compiled u... DB2 2
Search our Forums:

Back to Top