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 default now;
    alter table p_asset add mydate datetime default time;
        alter table p_asset add mydate datetime default date();
    alter table p_asset add mydate datetime default datetime();


How can I add the default now value into the specified column?
I try to find in the mysql manual,but in the default value charter,no relative information can be found.
I also know this question is stupid,but hope you help.

Default values must be constants:


http://www.mysql.com/doc/en/CREATE_TABLE.html

To get a column initialized with the time of insertion, you might
consider using TIMESTAMP. But be sure to read about its properties
and understand how it works:

http://www.mysql.com/doc/en/DATETIME.html




Best regards.

MaFai
[EMAIL PROTECTED]
2003-06-25


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


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



Reply via email to