Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Update/Inserted records in a certain date/time.
Mon, Jan 7 2013 8:03 AMPermanent Link

Abdulaziz Al-Jasser

Hi,
Is it possible to know what the updated/inserted records in a table at a certain date or time a using SQL?  Does each record in EDB have a date/time stamp?

Regards,
Abdulaziz Jasser
Mon, Jan 7 2013 8:46 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Abdulaziz


>Is it possible to know what the updated/inserted records in a table at a certain date or time a using SQL? Does each record in EDB have a date/time stamp?

Its not native to ElevateDB so you'll need to implement your own columns and triggers to get that information.

Roy Lambert [Team Elevate]
Mon, Jan 7 2013 11:10 PMPermanent Link

Barry

Abdulaziz Jasser,

Here is trigger-free solution.
This simplest way would be to add a couple of columns to the table defined as:

"Add_Date" TIMESTAMP DEFAULT Current_TimeStamp  NOT NULL
"Mod_Date" TIMESTAMP GENERATED ALWAYS AS Current_TimeStamp  NOT NULL

The Add_Date gets updated only when the row is inserted.
The Mod_Date gets updated whenever the row is updated (or inserted).

You can then use SQL on these columns like any other TimeStamp column to find rows that were added in the past day, or updated in the past hour etc. (see "Interval" in SQL manual when doing date arithmetic).

Barry
Tue, Jan 8 2013 12:29 PMPermanent Link

Abdulaziz Al-Jasser

Barry,

This is what I had in my mine.  But I was checking if EDB has this feature built-in.

Roy and Barry...big thanks to you.

Regards,
Abdulaziz Jasser
Image