MySQL Forums
Forum List  »  InnoDB

FOREIGN KEY CONSRAINT NOT WORKING
Posted by: Anmol Bhasin
Date: August 03, 2005 12:45PM

Hello all,

I am relatively new to MYSQL and my problem is that I have created a few tables

CREATE TABLE `USERDETAIL` (`UID` int(11) NOT NULL, `NAME` char(64) DEFAULT NULL,`DESIGNATION` varchar(255) DEFAULT "LITGLOSS USER",`EMAIL` char(64) NOT NULL,`VCODE` int(11) DEFAULT NULL,`TSTAMP` TIMESTAMP DEFAULT NULL,PRIMARY KEY(`UID`),UNIQUE KEY(`VCODE`)) TYPE=INNODB;

and another similar table called LANGUAGES

Now I constructed a third table

CREATE TABLE `PENDING_USER` (`UID` int (11) NOT NULL,`LID` int(11) NOT NULL, PRIMARY KEY (`UID`,`LID`), FOREIGN KEY (`UID`) REFERENCES USERDETAIL(`UID`) ON DELETE CASCADE, FOREIGN KEY (`LID`) REFERENCES LANGUAGE(`LID`) ON DELETE CASCADE) TYPE=INNODB;

This table has two foreign keys on the previous tables, however even when the above two tables are empty the system allows me to enter values into this PENDING_USER table. I thought INNODB supports foreign keys. MySql version is 3.23.49.

Any help would be appreciated.

Anmol

Options: ReplyQuote


Subject
Views
Written By
Posted
FOREIGN KEY CONSRAINT NOT WORKING
2723
August 03, 2005 12:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.