List:General Discussion« Previous MessageNext Message »
From:Vivian Wang Date:July 31 2002 6:39pm
Subject:Re: CREATE/CHECK syntax
View as plain text  
 From create syntax, you cannot put , after VARCHAR(1). You have another , 
after AUTO_INCREMENT, maybe it is not correct too.
At 01:56 PM 7/31/2002 -0400, Larry Irwin wrote:
>Using MySQL 4.02 on SuSE Linux 7.3
>The MySQL docs at http://www.mysql.com/doc/C/R/CREATE_TABLE.html state that
>CHECK (expr) is not parsed for table types other that innodb. But when the
>table type is innodb I assume it is parsed. I'd like to retain the CHECK
>parameters in my CREATE scripts, but can't seem to get past the parser.
>Eample:
>CREATE TABLE IF NOT EXISTS apptype (
>   aptype_id       INT UNSIGNED NOT NULL AUTO_INCREMENT,
>                         PRIMARY KEY (aptype_id),
>   max_sched     VARCHAR(1),
>                         CHECK (max_sched REGEXP "[0-9]")
>) TYPE=Innodb;
>This generates:
>ERROR 1064: You have an error in your SQL syntax near '(max_sched REGEXP
>"[0-9]"
>Is there a syntax that will pass the parser? Or should the CHECK option in
>the CREATE TABLE documentation be removed completely?
>Best Regards,
>Larry Irwin
>CCA Medical
>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 <mysql-thread116032@stripped>
>To unsubscribe, e-mail 
><mysql-unsubscribe-vivianwang=tcindex.com@stripped>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Thread
CREATE/CHECK syntaxLarry Irwin31 Jul
  • Re: CREATE/CHECK syntaxVivian Wang31 Jul
    • Re: CREATE/CHECK syntaxLarry Irwin1 Aug