Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    9

    Unanswered: what is the best practice to be aware of database updates?

    Hi,

    I have a collection for example, which holds data from a database query. Now i do not want to request the database everytime a collection is needed but only when data in the database has been changed. What would be the best practice for this approach? are there any 'statistic tables' provided by db2?

    thx,
    Dirk

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: what is the best practice to be aware of database updates?

    There is no table provided by DB2 ...

    My suggested approach will be to create a trigger on the table, and whenever the table changes , the trigger can update a single row table with the change timestamp .. Whenever you application wants data, you can query this table

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Nov 2003
    Posts
    9

    Re: what is the best practice to be aware of database updates?

    Originally posted by sathyaram_s
    There is no table provided by DB2 ...

    My suggested approach will be to create a trigger on the table, and whenever the table changes , the trigger can update a single row table with the change timestamp .. Whenever you application wants data, you can query this table

    HTH

    Sathyaram

    ok. but what if I am not allowed to setup a new table? Would it be also a "common approach" to query the table for the latest timestamp and compare it to a variable, which holds the latest timestamp-1 of the updated row on my first query?

Posting Permissions

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