If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to get application name that has updated some data in table?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-09-09, 08:56
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
How to get application name that has updated some data in table?

Hi,
I have a table in db2 v9.5 on Linux that multiple programs are updating values. The problem now appears that for some strange reason one of the production application on some rare situation doesn't work as it should, it updates the wrong values to the table.

I have written trigger to insert to new table every value before original table gets updated.

CREATE TRIGGER ADMIN.MYTRIGGER
AFTER UPDATE ON ADMIN.MYTABLE_ORIGINAL
REFERENCING OLD AS OLD
FOR EACH ROW
BEGIN ATOMIC
INSERT INTO ADMIN.MYTABLE_NEW VALUES (OLD.DATE, OLD.COUNTRY);
END
@

Question: Is there any way to get application name that has updated original table? Something like "Application Name" from "db2 list application" command? The idea is to get application name that corrupts data.
Regards
Reply With Quote
  #2 (permalink)  
Old 04-09-09, 09:28
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
You can try the value of the CURRENT CLIENT_APPLNAME special register, but the application must set it first. It can be done via a CLI call or as a JDBC connection property.
Reply With Quote
  #3 (permalink)  
Old 04-10-09, 03:44
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Is there any other way but settings special register in applications? The problem is I don't know which applications are accessing my table.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On