At 23:10 -0500 6/24/03, MaFai wrote:
Hello, mysql,
A table contains a column named mydate.
//Wrong sql statement
alter table p_asset add mydate datetime default now();
alter table p_asset add mydate datetime default time();
alter table p_asset add mydate datetime
# [EMAIL PROTECTED] / 2003-06-25 12:05:49 +0800:
//Wrong sql statement
alter table p_asset add mydate datetime default now();
alter table p_asset add mydate datetime default time();
alter table p_asset add mydate datetime default now;
alter table p_asset add mydate
alter table p_asset add mydate datetime default 'now()';
- you need the '' around now(); apparently
http://www.mysql.com/doc/en/DATETIME.html
and scroll down to the comment made by
Lazy Soul on Tuesday May 27 2003, @8:15am
Jan
Janice Wright
Ingenta plc
[EMAIL PROTECTED]
# [EMAIL PROTECTED] / 2003-06-25 06:18:04 +0100:
Sometime recently MaFai said:
A table contains a column named mydate.
//Wrong sql statement
alter table p_asset add mydate datetime default now();
alter table p_asset add mydate datetime default time();
alter
You're right, just tested it myself on 3.23.41; and I get exactly
the same result as you. We should post an amendment to the docs
on the website.
However, (still with 3.23.41):
mysql create table autotime2 (foo int, bar timestamp default now());
ERROR 1064: You have an error in your SQL syntax
# [EMAIL PROTECTED] / 2003-06-25 07:10:46 +0100:
Sometime recently Roman Neuhauser said:
# [EMAIL PROTECTED] / 2003-06-25 06:18:04 +0100:
alter table p_asset add mydate datetime default 'now()';
- you need the '' around now(); apparently
Also doesnt work in 4.1 alpha.
Best regards
Nils Valentin
Tokyo/Japan
(As requested I took Roman of , as he doesnt like direct e-mails ;-)
2003 6 25 19:12Roman Neuhauser :
# [EMAIL PROTECTED] / 2003-06-25 06:18:04 +0100:
Sometime recently MaFai said:
A table contains a column named
The TIMESTAMP column type does this for you:
See: http://www.mysql.com/doc/en/DATETIME.html
Regards,
Mike Hillyer
www.vbmysql.com
-Original Message-
From: MaFai [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 11:01 AM
To: [EMAIL PROTECTED]
Subject: datetime column dummy
Hello, mysql,
A table contains a column named mydate.
//Wrong sql statement
alter table p_asset add mydate datetime default now();
alter table p_asset add mydate datetime default time();
alter table p_asset add mydate datetime default now;
alter