List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:August 7 2002 3:04pm
Subject:Re: How have a DEFAULT =NOW() for DATETIME fields ?
View as plain text  

Andreas wrote:

> Victor Pendleton wrote:
> > See if this helps:
> > Defaults must be constants. Therefore NOW(), CURRENT_DATE or other 
> functions
> > can not be used for DATETIMETIME OR TIMESTAMP columns.. But your first
> > TIMESTAMP column will automatically be inserted/updated when you 
> perform an
> > action that changes the row. You can explicitly set the TIMESTAMP 
> value as
> > well.
>
> thanks for your fast reaction.
> It's a pitty we can't have it in one step when the record is created. I
> know PostgreSQL could do this so I hoped mySQL could, too. 


What do you mean?

>
>
> My idea(l) was to have two timestamps where the first one gets updated
> as you mentioned. 


Both get updated on insert.

Only the first gets updated during an update.

What seems to be the problem?

>
>
> thanks
>     andreas
>
>


Thread
How have a DEFAULT =NOW() for DATETIME fields ?Andreas7 Aug
  • Re: How have a DEFAULT =NOW() for DATETIME fields ?nick gatsis8 Aug
RE: How have a DEFAULT =NOW() for DATETIME fields ?Victor Pendleton7 Aug
  • Re: How have a DEFAULT =NOW() for DATETIME fields ?Andreas7 Aug
  • Re: How have a DEFAULT =NOW() for DATETIME fields ?Gerald Clark7 Aug