| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| I have a small requirement where by I want to retrieve all the records in a table modified since last 24 hours. Can anyone please help me out with this query? Is this possible? TIA. |
|
#2
|
| godsonr-at-vsnl.net wrote: > I have a small requirement where by I want to retrieve all the records in > a table modified since last 24 hours. Can anyone please help me out with > this query? You have to add a column to the table which stores the time of the last modification. The values in that column can be maintained by triggers. Then you can query the table and filter based on that column. -- Knut Stolze DB2 z/OS Utilities Development IBM Germany |
|
#3
|
| You would need to add a column that contains the timestamp of the last UPDATE, and then create a TRIGGER on UPDATE to put in the current timestamp. You could then select the rows that have a timestamp within the last 24 hours. You could do the same thing with a TRIGGER on INSERT to capture any rows inserted in the last 24 hours. godsonr-at-vsnl.net wrote: > I have a small requirement where by I want to retrieve all the records in a table modified since last 24 hours. Can anyone please help me out with this query? > > Is this possible? > > TIA. > |
![]() |
| Thread Tools | |
| Display Modes | |