Forum OpenACS Q&A: Please help on a Mysql basic issue

Collapse
Posted by Alex Val on
In a unix/apache server, through a web-interface
I tried to define a table and get the following,
can you tell me where's the error?

Do you know what's wrong with this?
Thanks
Alex

---------------------------------------------------
Database test2 - table table1
Error
SQL-query :
CREATE TABLE `table1` (`tkey` INT(4) NOT NULL AUTO_INCREMENT, `tdate` DATE(10) NOT NULL, `ttext` CHAR(60) NOT NULL, INDEX (`tkey`))

MySQL said:
You have an error in your SQL syntax near '(10) NOT NULL, `ttext` CHAR(60) NOT NULL, INDEX (`tkey`))' at line 1
----------------------------------------------------

Collapse
Posted by John Pickett on
Not quite sure why you're posting this here?  OpenACS doesn't run on MySQL...  Either way, I'm not 100% sure, but I don't think you need to specify the (10) size for the date data type.  just say 'tdate' date not null, etc...

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

The MySQL docs don't say there's an optional length to the date type, so I'm guessing that's where the problem is (especially since that's where the error points to).