Re: Functions as default values

2003-08-14 Thread Cybot
I am trying to use a function as a default value for a column but do not seem to get the desired result. I want to use the NOW() function for a last_updated column, here is my code... CREATE TABLE test_table ( last_updated datetime NOT NULL default `NOW()` ) TYPE=MyISAM; This gives an error; CRE

RE: Functions as default values

2003-08-06 Thread Phil Ewington - 43 Plc
No functions as default values is a bummer, but timestamp will do he trick, so thanks for your help; much appreciated. Phil. -Original Message- From: Cybot [mailto:[EMAIL PROTECTED] Sent: 06 August 2003 15:37 To: [EMAIL PROTECTED] Subject: Re: Functions as default values > I am try

Re: Functions as default values

2001-09-24 Thread Rodney Broom
From: Gerald Clark <[EMAIL PROTECTED]> > Default values must be constants. > Håkan Elmqvist wrote: > > Now I want to register who changed it... ===> MY two cents worth: With MySQL, this sort of thing usually gets handled in a piece of software. In Perl, we might say something like: $sth =

Re: Functions as default values

2001-09-24 Thread Gerald Clark
You can't. Default values must be constants. Håkan Elmqvist wrote: > Timestamp is a useful datatype when you want to register when a record > changed. Now I want to register who changed it and tried to use user() > as a default value and my database just returned user() as the field > value.