List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:February 5 2004 11:46am
Subject:Re: [Q] setting DATE field with default NOW value?
View as plain text  
Hi,


> In a table definition, how do I get a date field to be
> assigned as DEFAULT the current date?
>
> I tried:
>
> dateField DATE DEFAULT CURDATE()
>
> but that gives me syntax errors....
>
> Help?

According to the documentation for the DEFAULT <value>
clause, <value> can only be a real value. Not a function.

So basically, you're out of luck.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com

Thread
[Q] setting DATE field with default NOW value?Riaan Oberholzer5 Feb
  • Re: [Q] setting DATE field with default NOW value?Martijn Tonies5 Feb
  • Re: [Q] setting DATE field with default NOW value?KKoTY5 Feb
  • Re: [Q] setting DATE field with default NOW value?Martijn Tonies5 Feb
    • Re: [Q] setting DATE field with default NOW value?Brent Baisley5 Feb