Re: CHECK constraint

2005-06-26 Thread Mathias
Hi, your enum canbe NULL and is not indexed. So you can insert values not in enum, replaced by NULL. a solution is to UNIQUE index the enum column, and insert a unique bad value in it. Any value not in enum can not then be inseted : mysql> create table enum_test(id int, name enum('test1','test2')

Re: CHECK constraint

2005-06-25 Thread Michael Kruckenberg
Hi, Use enum with a default type and let mysql do the check for you. The problem with an enum is that if you insert a value that's not in the enum, MySQL doesn't stop the insert, it leaves the column empty. This doesn't enforce data integrity like I think Chris wanted. mysql> desc enum_tes

Re: CHECK constraint

2005-06-25 Thread Mathias
tween the tblJob.JobType and JobType.Name, > and make sure that the only entries in the JobType.Name column are > those you want to appear in the tblJob.JobType column. > > On Jun 25, 2005, at 10:28 AM, Chris Andrew wrote: > > > Dear List, > > > > My system is RedHat

Re: CHECK constraint

2005-06-25 Thread Rhino
ANTs don't permit any person or program to insert data directly via the table. Rhino - Original Message - From: "Partha Dutta" <[EMAIL PROTECTED]> To: "'Michael Kruckenberg'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: Sent: Saturday, J

RE: CHECK constraint

2005-06-25 Thread Partha Dutta
Another approach would be to use a view with a CHECK OPTION. This will allow the view to behave exactly like a check constraint: CREATE VIEW tblJob_view AS SELECT JobId, CustomerId, JobType, Description, QuotationDate, OrderDate FROM tblJob WHERE JobType IN ('Desig

Re: CHECK constraint

2005-06-25 Thread Michael Kruckenberg
he JobType.Name column are those you want to appear in the tblJob.JobType column. On Jun 25, 2005, at 10:28 AM, Chris Andrew wrote: Dear List, My system is RedHat EL3 and MySQL 5.0.7-beta. I wanted to implement a check constraint (below), but after some testing and googling, it seems I can

CHECK constraint

2005-06-25 Thread Chris Andrew
Dear List, My system is RedHat EL3 and MySQL 5.0.7-beta. I wanted to implement a check constraint (below), but after some testing and googling, it seems I can't do this with MySQL. I've read suggestions that check(s) should be done using triggers. Is a trigger a preferred method of ach

Re: question: check constraint

2004-03-13 Thread Paul DuBois
At 20:10 -0800 3/13/04, Andrew Zhu wrote: Mysql 4.0.12 on win xp. Question: is the check constraint supported? Example: create table temp ( c1 varchar (50) check (c1 like "[EMAIL PROTECTED]") ); insert into temp values ("whatever"); will succeed. Is my constraint wrong (sa

question: check constraint

2004-03-13 Thread Andrew Zhu
Mysql 4.0.12 on win xp. Question: is the check constraint supported? Example: create table temp ( c1 varchar (50) check (c1 like "[EMAIL PROTECTED]") ); insert into temp values ("whatever"); will succeed. Is my constraint wrong (say to check the email address)? or this is

Re: CHECK constraint

2003-11-28 Thread Martijn Tonies
let me do. > > mysql> insert into test values (-1); > Query OK, 1 row affected (0.00 sec) > > mysql> select *From test; > +--+ > | age | > +--+ > | -1 | > +--+ > 1 row in set (0.01 sec) > > How can I enforce the CHECK constraint ? MySQL

CHECK constraint

2003-11-28 Thread Mayuran
row affected (0.00 sec) mysql> select *From test; +--+ | age | +--+ | -1 | +--+ 1 row in set (0.01 sec) How can I enforce the CHECK constraint ? thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Check Constraint In Mysql

2001-12-23 Thread amit lonkar
Hi !!! Is there a check constraint available in Mysql? If there is one plase send the Syntax as well Amit Lonkar __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com

CHECK CONSTRAINT

2001-04-20 Thread VVM Ravikumar Sarma Chengalvala
Hi, Any round about way of achieving CHECK CONSTRAINT FEATURE in MySQL before inserting a data into database? REgards, Ravi Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at