Achille,
Tuesday, December 03, 2002, 11:08:19 AM, you wrote:

AML> MySQL seems to support the CHECK() clausole in the implementation of CREATE
AML> TABLE statement, but MySQL (Ver 11.15 Distrib 3.23.39, for pc-linux-gnu)
AML> returns a syntax error on such a command. For example:

AML> mysql> CREATE TABLE example (var INTEGER, CHECK(var BETWEEN 0 AND 1));
AML> ERROR 1064: You have an error in your SQL syntax near '(var BETWEEN 0 AND
AML> 1))' at line 1

AML> If I remove the CHECK clausole, the sql statement works:

AML> mysql> CREATE TABLE example (var INTEGER);
AML> Query OK, 0 rows affected (0.01 sec)

AML> Can anyone suggest me how to correctly use the CHECK clausole in MySQL
AML> (even if for compatibility issues with other sql databases) ?

Here is:

mysql> CREATE TABLE example (var INTEGER, constraint var CHECK( var BETWEEN 0 AND 1));
Query OK, 0 rows affected (0.01 sec)

But CHECK clause does nothing in MySQL.




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
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

Reply via email to