OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Default Date and Time

From: Max Bube (maxbubegmail.com)
Date: Fri Jun 26 2009 - 12:43:41 CDT


Hi Jason

The DEFAULT value can't be an expression.

2009/6/26 Jason Todd Slack-Moehrle <mailinglistsmailnewsrss.com>

> Hi All,
>
> I want to create a table that defaults to current_date and current_time.
>
> I have:
>
> CREATE TABLE `personalevent`(
> `pevent` mediumint(10) NOT NULL,
> `eventid` mediumint(10) NOT NULL,
> `userid` mediumint(10) NOT NULL,
> `username` varchar(10) NOT NULL,
> `password` varchar(10) NULL,
> `country` varchar(45) NULL,
> `zipcode` varchar(5) NULL,
> `city` varchar(35) NULL,
> `hstate` varchar(45) NULL,
> `exclusive` varchar(7) NULL,
> `eventtime` time NULL DEFAULT current_time(),
> `eventdate` date NULL DEFAULT current_date(),
> `eventdura` varchar(35) NULL,
> `daysevent` varchar(10) NULL,
> `crowd` varchar(25) NULL,
> `venue` varchar(50) NULL,
> `activitytype` varchar(45) NULL,
> `actdetails` varchar(255) NULL,
> `encodedby` varchar(100) NULL,
> `curmo` varchar(2) NULL,
> `pageweb` varchar(50) NULL,
> PRIMARY KEY (`pevent`)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
>
> But this throws a syntax error. I have tried Now() as well.
>
> What am I doing wrong?
>
> Best,
>
> -Jason
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=maxbubegmail.com
>
>