September 12th, 2000, 10:03 AM
when creating a table, i tried to define
a default value for a date column.
'contact date not null default "now()",'
this doesnt do anything.
is it possible to define a default (sysdate) for date columns under mysql?
September 12th, 2000, 10:19 AM
Remove the double quotes from around now() so mysql knows you are defaulting to a function. With quotes it tries to insert the text "now()" which isn't valid for a date field and results in zeroes.
September 12th, 2000, 10:23 AM
mysql> create table test (name varchar(32), datum date default now());
ERROR 1064: You have an error in your SQL syntax near 'now())' at line 1
i tried this too, but...
do you have another suggestion?