MySQL Forums
Forum List  »  InnoDB

check constraint
Posted by: Denis Gefke
Date: May 09, 2007 01:54AM

Hi all. Sorry for my English.
Please, tell me, can i use CHECK constraint in create table statement? I create table with check. There are no erros. But then i try to add new row with incorrect value, this constraint does not work :(.

CREATE TABLE IF NOT EXISTS gvars
id int unsigned NOT NULL PRIMARY KEY,
name varchar(256) NOT NULL UNIQUE,
value int NOT NULL default 0,
min_value int NOT NULL default -1000,
max_value int NOT NULL default 1000,
descript varchar(2048),
CHECK (name LIKE 'g%');

Options: ReplyQuote


Subject
Views
Written By
Posted
check constraint
100468
May 09, 2007 01:54AM
39068
May 28, 2007 05:05PM
31263
June 07, 2007 07:31PM
27914
June 21, 2007 10:58PM
26130
June 28, 2007 03:02AM
24212
December 06, 2007 02:01PM
16773
October 15, 2008 04:08AM
16606
November 15, 2008 01:23AM
12171
November 15, 2008 11:09AM
18499
December 31, 2008 09:58AM
12693
January 06, 2009 03:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.