Only static data is allowed as default-values; functions, derived data etc, are not allowed.

An unfortunate shortcoming.

On the flipside, there is some weird rule that the first timestamp in a table will be set with the current date/time during an insert if the column is left out of the insert clause (ie you try to insert null). It's an ugly cludge, unfort., but it might do the trick for you.

David

Chris W. Parker wrote:

Robert Adkins <mailto:[EMAIL PROTECTED]>
   on Friday, October 15, 2004 12:23 PM said:



   INV_DATE             DATETIME   DEFAULT NOW()   NOT NULL,
   );

I receive an error message stating that there is an error with
'NOW()'



[snip]



Is there a very different method of doing this under MySQL 4.0.21?



I think MySQL does not support a default value of NOW() like you'd expect it to. Yeah I know, it sucks. I don't know at what point this was added, if it's been added at all. (My MySQL version is a bit old also.)



Chris.





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to