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')
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
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
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
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
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
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
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
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
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
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]
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
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
13 matches
Mail list logo