List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:January 15 2002 1:45pm
Subject:Re: pb with integrity constraint
View as plain text  
See doc sections:

 From the CREATE TABLE docs:

	"The FOREIGN KEY, CHECK, and REFERENCES clauses don't 
actually do anything. The syntax for them is provided only for 
compatibility, to make it easier to port code from other SQL servers 
and to run applications that create tables with references. See 
section 1.7.4 MySQL Differences Compared to ANSI SQL92."

And, judging by the .fr domain, you might be interested in French 
translations of the docs:


At 11:46 AM +0100 1/15/02, TOMASSONI Dominique wrote:
>Hi the list,
>I try to create tables with integrity constraint but it seems no running.
>I've got the next script :
>create table USERS
>     USER_CODE               INT(8)                 not null,
>     USER_NAME               VARCHAR(30)            not null,  
>     primary key (USER_CODE)
>create table ENV
>     USER_CODE               INT(8)                 not null,
>     CODE_ENV                VARCHAR(6)             not null,
>     primary key (USER_CODE, CODE_ENV),
>     constraint FK_USER foreign key (USER_CODE) references USERS(USER_CODE)
>The tables creation are ok, but when I insert values in the table ENV
>without any data in USERS it works but normally it wouldn't.
>Something bad in may script ?

| Steve Edberg                                      sbedberg@stripped |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin      |
| "Restriction of free thought and free speech is the most dangerous of  |
| all subversions. It is the one un-American act that could most easily  |
| defeat us."                                                            |
|                 - Supreme Court Justice (1939-1975) William O. Douglas |
pb with integrity constraintTOMASSONI Dominique15 Jan
  • Re: pb with integrity constraintSteve Edberg15 Jan
    • Re: pb with integrity constraintErv Young16 Jan