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
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
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 =
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.