At 2:46 PM -0400 09-06-2000, Jeff Brewer wrote:
>Hello,
>
>Is it possible to default a datetime column to be the time the column is
>inserted? The following fails for me on 3.23.21:
>
> create table testtable( samplecol datetime default now())
>
>as does
>
> create table testtable( samplecol datetime default now)
Default column values must be constants. You could use a TIMESTAMP
column instead, but then it would also be updated after insert time
if you update any of the other columns. You may not want that, in which
case leave the column as a DATETIME type and explicitly set it to NOW()
when you create records.
--
Paul DuBois, paul@stripped