Thread: keeping track of date

keeping track of date

From
admin
Date:
What would be the recommended way to keep track of the date/time a tuple
was inserted?

Should I be using triggers on insert, or is there an internal variable I
can use to avoid creating another field?

Thanks,
Marc


Re: [GENERAL] keeping track of date

From
Ed Loehr
Date:
admin wrote:

> What would be the recommended way to keep track of the date/time a tuple
> was inserted?
>
> Should I be using triggers on insert, or is there an internal variable I
> can use to avoid creating another field?

Here's how I'm doing it:

CREATE TABLE mytable (
    ...
    creation_time  DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

Cheers,
Ed Loehr