The "," is required before the PRIMARY KEY declaration. It fails without it. Removing the "," before the CHECK declaration simply generates a similar error sooner: ERROR 1064: You have an error in your SQL syntax near 'CHECK (max_sched REGEXP "[0-9]")) TYPE=Innodb;'
v> From create syntax, you cannot put , after VARCHAR(1). You have another , v> after AUTO_INCREMENT, maybe it is not correct too. v> At 01:56 PM 7/31/2002 -0400, Larry Irwin wrote: > l>Using MySQL 4.02 on SuSE Linux 7.3 > l>The MySQL docs at http://www.mysql.com/doc/C/R/CREATE_TABLE.html state that > l>CHECK (expr) is not parsed for table types other that innodb. But when the > l>table type is innodb I assume it is parsed. I'd like to retain the CHECK > l>parameters in my CREATE scripts, but can't seem to get past the parser. > l>Eample: > l>CREATE TABLE IF NOT EXISTS apptype ( > l> aptype_id INT UNSIGNED NOT NULL AUTO_INCREMENT, > l> PRIMARY KEY (aptype_id), > l> max_sched VARCHAR(1), > l> CHECK (max_sched REGEXP "[0-9]") > l>) TYPE=Innodb; > l>This generates: > l>ERROR 1064: You have an error in your SQL syntax near '(max_sched REGEXP > l>"[0-9]" > l>Is there a syntax that will pass the parser? Or should the CHECK option in > l>the CREATE TABLE documentation be removed completely? > l>Best Regards, > l>Larry Irwin > l>CCA Medical > l>sql, query --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php