Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread How to get TimeStamp to automatically timestamp a record when it changes?
Sat, Aug 4 2007 1:20 PMPermanent Link

Dave Harrison
I thought the TimeStamp field type would automatically put the date/time
of when the record was created/modified like it does in MySQL, but it
doesn't.

How can I automatically timestamp a record whenever it changes without
resorting to code? I have several tables that are created dynamically
from this structure and I don't want to have to remember to assign
before post events to each table instance. (I suppose I'll have to
unless there is a simpler way).

Dave
DBISAM 4.25
Sat, Aug 4 2007 1:57 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Dave


With DBISAM the only way of doing this is code. The best I can suggest is add a BeforeUpdateTrigger, check for a specific tablename, fieldname (or type) and stuff the timestamp in.


Roy Lambert
Sat, Aug 4 2007 5:52 PMPermanent Link

"Robert"

"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:01AB98F6-E17B-4882-8837-213ABBE41CE2@news.elevatesoft.com...
.. The best I can suggest is add a BeforeUpdateTrigger,

BeforePost. That way you also catch new rows.

Robert

Sat, Aug 4 2007 6:01 PMPermanent Link

Dave Harrison
Robert wrote:

> "Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
> news:01AB98F6-E17B-4882-8837-213ABBE41CE2@news.elevatesoft.com...
> . The best I can suggest is add a BeforeUpdateTrigger,
>
> BeforePost. That way you also catch new rows.
>
> Robert
>
>
Robert,
     That would work if there were only 1 table. But I'm also creating
tables dynamically with the same record structure so I could easily
forget to add that event to each table. A trigger is centralized in the
engine so it catches all the table updates . Smile

Dave
Fri, Aug 10 2007 6:10 AMPermanent Link

Chris Erdal
Dave Harrison <daveh_18824@spammore.com> wrote in news:CC5E3C8E-A91E-48B7-
8B98-5A5AB37385BD@news.elevatesoft.com:

> A trigger is centralized in the
> engine so it catches all the table updates . Smile

perhaps a bit late if your database is already out there, but you could
give the same name to all Timestamp fields in every table that need this
functionality, and incorporate the update for this particular field (if
there is one) on every trigger call.
--
Chris
(XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3)

Image