473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Column constraints

Hi,

I am not familiar with MySQL, but we are currently looking at it.
Currently our software product supports Oracle, DB2, and we want to
see what it takes to also include MySQL.

One stumbling block we have come across is that it seems that the
CREATE TABLE command does not support the CHECK CONSTRAINT on a
column. I know there is such a thing as the ENUM column in MySQL, but
what if we want to set the constraint between two values.

Example:

CREATE TABLE TMPTABLE
COLONE CHAR(10),
COLTWO INT CHECK (COLTWO BETWEEN 1 AND 200)....
Is there such a thing in MySQL.

Thanks
Ron VanDerMaarel
Jul 19 '05 #1
4 10400
Hi Ron,

In answer to your question, MySQL parses the CHECK constraint for
compatibility with other database systems, but is otherwise ignored, so in
short "No". Another downside is no triggers or stored procedures in ver 4.
Other than that is is a great DBMS.

Regards,
Adam

"Ron VanDerMaarel" <vd*****@yahoo.com> wrote in message
news:1b**************************@posting.google.c om...
Hi,

I am not familiar with MySQL, but we are currently looking at it.
Currently our software product supports Oracle, DB2, and we want to
see what it takes to also include MySQL.

One stumbling block we have come across is that it seems that the
CREATE TABLE command does not support the CHECK CONSTRAINT on a
column. I know there is such a thing as the ENUM column in MySQL, but
what if we want to set the constraint between two values.

Example:

CREATE TABLE TMPTABLE
COLONE CHAR(10),
COLTWO INT CHECK (COLTWO BETWEEN 1 AND 200)....
Is there such a thing in MySQL.

Thanks
Ron VanDerMaarel

Jul 19 '05 #2
Yeah, but ver 5 is getting closer and closer

Bill

"Adam Cooper" <a@z.em> wrote in message
news:E2********************@wards.force9.net...
Hi Ron,

In answer to your question, MySQL parses the CHECK constraint for
compatibility with other database systems, but is otherwise ignored, so in
short "No". Another downside is no triggers or stored procedures in ver 4.
Other than that is is a great DBMS.

Regards,
Adam

"Ron VanDerMaarel" <vd*****@yahoo.com> wrote in message
news:1b**************************@posting.google.c om...
Hi,

I am not familiar with MySQL, but we are currently looking at it.
Currently our software product supports Oracle, DB2, and we want to
see what it takes to also include MySQL.

One stumbling block we have come across is that it seems that the
CREATE TABLE command does not support the CHECK CONSTRAINT on a
column. I know there is such a thing as the ENUM column in MySQL, but
what if we want to set the constraint between two values.

Example:

CREATE TABLE TMPTABLE
COLONE CHAR(10),
COLTWO INT CHECK (COLTWO BETWEEN 1 AND 200)....
Is there such a thing in MySQL.

Thanks
Ron VanDerMaarel


Jul 19 '05 #3
Hi Ron,

In answer to your question, MySQL parses the CHECK constraint for
compatibility with other database systems, but is otherwise ignored, so in
short "No". Another downside is no triggers or stored procedures in ver 4.
Other than that is is a great DBMS.

Regards,
Adam

"Ron VanDerMaarel" <vd*****@yahoo.com> wrote in message
news:1b**************************@posting.google.c om...
Hi,

I am not familiar with MySQL, but we are currently looking at it.
Currently our software product supports Oracle, DB2, and we want to
see what it takes to also include MySQL.

One stumbling block we have come across is that it seems that the
CREATE TABLE command does not support the CHECK CONSTRAINT on a
column. I know there is such a thing as the ENUM column in MySQL, but
what if we want to set the constraint between two values.

Example:

CREATE TABLE TMPTABLE
COLONE CHAR(10),
COLTWO INT CHECK (COLTWO BETWEEN 1 AND 200)....
Is there such a thing in MySQL.

Thanks
Ron VanDerMaarel

Jul 19 '05 #4
Yeah, but ver 5 is getting closer and closer

Bill

"Adam Cooper" <a@z.em> wrote in message
news:E2********************@wards.force9.net...
Hi Ron,

In answer to your question, MySQL parses the CHECK constraint for
compatibility with other database systems, but is otherwise ignored, so in
short "No". Another downside is no triggers or stored procedures in ver 4.
Other than that is is a great DBMS.

Regards,
Adam

"Ron VanDerMaarel" <vd*****@yahoo.com> wrote in message
news:1b**************************@posting.google.c om...
Hi,

I am not familiar with MySQL, but we are currently looking at it.
Currently our software product supports Oracle, DB2, and we want to
see what it takes to also include MySQL.

One stumbling block we have come across is that it seems that the
CREATE TABLE command does not support the CHECK CONSTRAINT on a
column. I know there is such a thing as the ENUM column in MySQL, but
what if we want to set the constraint between two values.

Example:

CREATE TABLE TMPTABLE
COLONE CHAR(10),
COLTWO INT CHECK (COLTWO BETWEEN 1 AND 200)....
Is there such a thing in MySQL.

Thanks
Ron VanDerMaarel


Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Shino | last post by:
Hi, Can anyone help with this error: "ORA-00904: invalid column name"? Thanks! SQL> create view PPFa as 2 SELECT L.UserID AS LecID, U.Name, U.Email, I.IntakeID, S.UserID AS StudID 3 FROM...
3
by: Gunnar Vøyenli | last post by:
Hi (SQL Server 2000) I have an existing table (t) with a column that is NOT an identity column (t.ID), but it has manually inserted "row numbers". I want to make this column become an identity...
2
by: DW | last post by:
Greetings: I have to do a one-off forceful change of some data in a database. I need to disable some FK constraints, make the data change, and then re-enable the constraints. My process will...
13
by: Bruno Panetta | last post by:
Suppose I have a table with the following columns: Year, SalesInEurope, SalesInAmerica, TotalSales. I want to add a new column called SalesInAsia, say, but I want it to appear before TotalSales....
2
by: ezra epstein | last post by:
Hi, I've got a table: <code language="SQL"> CREATE TABLE "common"."dynamic_enum" ( "pk_id" integer DEFAULT nextval('"common"."pw_seq"') , "enum_type" ...
5
by: Robert Stearns | last post by:
Either I missed something, or ALTER TABLE does not have this capability. Is there any way of doing it except DROPping all constraints which mention this table, EXPORTing the data, DROPping the...
2
by: Scott Goodwin | last post by:
In the following example: create table parent ( id integer unique not null, name varchar(24) ); create table child ( first_name varchar(256), last_name varchar(256)
2
by: Scott Goodwin | last post by:
The following SQL: create table toinherit ( id integer primary key ); create table leftside ( leftname varchar(64) not null unique ) inherits (toinherit);
4
by: Jeff Kish | last post by:
Hi. I have a database I need to supply something (I'm assuming a t-sql script.. maybe something else is better) to update customer tables with. The operations include mostly changing varchar...
5
by: yeoj13 | last post by:
Hello, I have a db2load script I'm using to populate a large table. Ideally, my target table is required to have "Not Null" constraints on a number of different columns. I've noticed a ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.