List:General Discussion« Previous MessageNext Message »
From:Ferindo Middleton Jr Date:January 20 2006 1:18am
Subject:problem with using CONSTRAINT declaration
View as plain text  
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)
);
Thread
problem with using CONSTRAINT declarationFerindo Middleton Jr20 Jan
  • Re: problem with using CONSTRAINT declarationGleb Paharenko20 Jan