You shouldn't have a problem if you list each foreign key separately, as follows:
foreign key (MenuName) references MenuDetails (MenuName)on update restrict on delete restrict, foreign key (MenuParentName) references MenuDetails (MenuParentName)on update restrict on delete restrict, That's how I did it on one of my tables that needed two foreign keys and it worked fine. --Michael --- "B.K.R. Shivaprakkash" <[EMAIL PROTECTED]> wrote: > Hi, > > The below mentioned sql makes an error when created > with two foreign key constraints under MySQL/Innodb > table type. Any help to solve this problem? > > create table UserMenuRestrictions > ( > CompanyCode char(10) not > null, > UserId char(10) not > null, > MenuName char(40) not > null, > MenuParentName char(40) not > null, > AddRight char(1) > , > EditRight char(1) > , > DeleteRight char(1) > , > ViewRight char(1) > , > Visible char(1) > , > Enabled char(1) > , > primary key (CompanyCode, UserId, MenuName, > MenuParentName), > foreign key (CompanyCode, UserId) > references UserDetails (CompanyCode, UserId) > on update restrict on delete restrict > , > foreign key (MenuName, MenuParentName) > references MenuDetails (MenuName, > MenuParentName) > on update restrict on delete restrict > ) type = innodb; > > Thankyou in advance. > > Happiness Always > BKR Shivaprakkash > > > __________________________________________________ > Do You Yahoo!? > Everything you'll ever need on one web page > from News and Sport to Email and Music Charts > http://uk.my.yahoo.com > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list > archive) > > To request this thread, e-mail > <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: > http://lists.mysql.com/php/unsubscribe.php > __________________________________________________ Do You Yahoo!? Yahoo! Autos - Get free new car price quotes http://autos.yahoo.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php