B.K.R.,
Saturday, July 13, 2002, 7:08:54 AM, you wrote:

BKRS> The below mentioned sql makes an error when created
BKRS> with two foreign key constraints under MySQL/Innodb
BKRS> table type.  Any help to solve this problem?

BKRS> create table UserMenuRestrictions
BKRS> (
BKRS>     CompanyCode        char(10)              not null,
BKRS>     UserId             char(10)              not null,
BKRS>     MenuName           char(40)              not null,
BKRS>     MenuParentName     char(40)              not null,
BKRS>     AddRight           char(1)                       ,
BKRS>     EditRight          char(1)                       ,
BKRS>     DeleteRight        char(1)                       ,
BKRS>     ViewRight          char(1)                       ,
BKRS>     Visible            char(1)                       ,
BKRS>     Enabled            char(1)                       ,
BKRS>     primary key (CompanyCode, UserId, MenuName,
BKRS> MenuParentName),
BKRS>     foreign key (CompanyCode, UserId)
BKRS>     references UserDetails (CompanyCode, UserId)
BKRS>     on update restrict on delete restrict            ,
BKRS>     foreign key (MenuName, MenuParentName)
BKRS>     references MenuDetails (MenuName, MenuParentName)
BKRS>     on update restrict on delete restrict
BKRS> ) type = innodb;

BKRS> Thankyou in advance.

You must create separate indexes on the pair of columns (CompanyCode, UserId) and
(MenuName, MenuParentName)





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.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

Reply via email to