Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jan 2003
    Posts
    1,605
    Is there any other way but settings special register in applications? The problem is I don't know which applications are accessing my table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •