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 > what is the best practice to be aware of database updates?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-14-04, 13:43
db2_learner99 db2_learner99 is offline
Registered User
 
Join Date: Nov 2003
Posts: 9
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
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 13:48
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #3 (permalink)  
Old 01-14-04, 14:02
db2_learner99 db2_learner99 is offline
Registered User
 
Join Date: Nov 2003
Posts: 9
Re: what is the best practice to be aware of database updates?

Quote:
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?
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