But how about TIMESTAMP?

For example:

CREATE TABLE time_test (creation_date TIMESTAMP, info VARCHAR(100));

This should work fine too,doesn't it?

-sherzodR



On Tue, 26 Jun 2001, Paul DuBois wrote:

> At 2:43 PM -0400 6/26/01, Richard Bates wrote:
> >How do I get a default date time in the create table clause...
> 
> The MySQL Reference Manual states that DEFAULT values must be constants.
> 
> Insert NOW() into the field when you create new records.
> 
> >
> >I have tried
> >
> >Create table(
> >     CreationDate    DATETIME    DEFAULT NOW(),
> >     Info        varchar(100)
> >     );
> >Create table(
> >     CreationDate    DATETIME    DEFAULT "NOW()",
> >     Info        varchar(100)
> >     );
> >
> >Create table(
> >     CreationDate    DATETIME    DEFAULT SYSDATE(),
> >     Info        varchar(100)
> >     );
> >Create table(
> >     CreationDate    DATETIME    DEFAULT "SYSDATE()",
> >     Info        varchar(100)
> >     );
> >
> >Create table(
> >     CreationDate    DATETIME    DEFAULT CURRENT_DATE(),
> >     Info        varchar(100)
> >     );
> >Create table(
> >     CreationDate    DATETIME    DEFAULT "CURRENT_DATE()",
> >     Info        varchar(100)
> >     );
> >
> >All without the quote return with invalid syntax.
> >With the quote inserts "000-00-00 00:00:00" meaining invalid date.
> >==================================
> >=== Richard Bates
> >=== TELEHOUSE America
> >==================================
> 
> 
> -- 
> Paul DuBois, [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to