I may have misunderstood but I would have thought the query would be like
CREATE TABLE Salespersons
(empid INTEGER NOT NULL PRIMARY KEY,
ename CHAR(15) NOT NULL,
rank INTEGER NOT NULL DEFAULT 1,
salary DECIMAL(7, 2) NOT NULL DEFAULT 1000.00,
CHECK (rank IN (1,2,3)),
CHECK (salary >= 1000.00));
But, yes, check does nothing anyway.
----- Original Message -----
From: "Quentin Bennett" <[EMAIL PROTECTED]>
To: "'Dan Nelson'" <[EMAIL PROTECTED]>; "SF" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, February 08, 2001 8:21
Subject: RE: CHECK variable incorrect?
> Hi,
>
> But the problem is that mysql is not accepting the syntax, not that it
will
> do nothing with it.
>
> Quentin
>
> -----Original Message-----
> From: Dan Nelson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 8 February 2001 12:40
> To: SF
> Cc: [EMAIL PROTECTED]
> Subject: Re: CHECK variable incorrect?
>
>
> In the last episode (Feb 07), SF said:
> > I did, and that's where I don't understand why this is happening.
> > The furthest I was able to get in the manual and/or any of the
> > archives from MySQL is:
> >
> > (straight out of the manual)
> > CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
> [(create_definition,...)]
> > [table_options] [select_statement]
> >
> > create_definition:
> > col_name type [NOT NULL | NULL] [DEFAULT default_value]
[AUTO_INCREMENT]
> > [PRIMARY KEY] [reference_definition]
> > or PRIMARY KEY (index_col_name,...)
> > or KEY [index_name] (index_col_name,...)
> > or INDEX [index_name] (index_col_name,...)
> > or UNIQUE [INDEX] [index_name] (index_col_name,...)
> > or FULLTEXT [INDEX] [index_name] (index_col_name,...)
> > or [CONSTRAINT symbol] FOREIGN KEY index_name (index_col_name,...)
> > [reference_definition]
> > or CHECK (expr)
> >
> > ^^^^^^^^^^^^
> > ||||||||||||
> >
> > The comment that CHECK (expr) is supposed to be written as such, is
> > something that I either don't understand - and if so, what is wrong with
> it
> > in the string I am using (line 4: "CHECK (rank IN (1,2,3))")? - or an
> error
> > I don't understand is causing this - that's why I'm asking.
>
> Look farther down in the manual:
>
> * The `FOREIGN KEY', `CHECK', and `REFERENCES' clauses don't
> actually do anything. The syntax for them is provided only for
> compatibility, to make it easier to port code from other SQL
> servers and to run applications that create tables with references.
> *Note Missing functions::.
>
> --
> Dan Nelson
> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> 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
>
> The information contained in this email is privileged and confidential
> and intended for the addressee only. If you are not the intended
> recipient, you are asked to respect that confidentiality and not
> disclose, copy or make use of its contents. If received in error
> you are asked to destroy this email and contact the sender immediately.
> Your assistance is appreciated.
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
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