473,413 Members | 2,058 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,413 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 10402
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.