Hello.
MySQL doesn't support this yet. The CHECK clause is parsed but ignored
by all storage engines.
Ferindo Middleton Jr wrote:
I have the following table where I have a CHECK CONSTRAINT to check for
logical data values but for some reason it's not working on INSERTs to
the table. MySQL doesn't give any error message when I CREATE TABLE. Any
ideas what I'm doing wrong?... or Is this type of declaration not
supported... What command can you issue from the command line to check
the existence of CONTRAINT declarations such as this?
CREATE TABLE schedules (
id SERIAL NOT NULL UNIQUE,
start_date DATE NOT NULL,
end_date DATE NOT NULL,
start_time TIME,
end_time TIME,
CONSTRAINT end_date_cannot_be_before_start_date CHECK (end_date =
start_date),
CONSTRAINT end_time_cannot_be_before_start_time CHECK (end_time =
start_time),
PRIMARY KEY (class_id, start_date, end_date, start_time, end_time)
);
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
__ ___ ___ __
/ |/ /_ __/ __/ __ \/ /Gleb Paharenko
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET
___/ www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]