OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: compound foreign key(s)

From: Ady Wicaksono (adywicaksonoregionalinvestment.com)
Date: Thu Oct 13 2005 - 08:09:56 CDT


Hi Guy,

Use SHOW INNODB STATUS and check foreign key error at there

Good luck

Guy Brom wrote:

> I have the following innoDb tables:
> country has `id` as PK
> lang has `id` as PK
>
> I want to have a 3rd innoDb table:
> countrylang with `cid,lang` as compound key with both `cid` and `lang`
> as foreign (cascade-delete) keys to the "master" tables.
>
> However mysql throws error (Cannot create table..) when I try to
> define `cid` as a foreign key to country.id
>
> country.id and countrytext.cid are both smallint(5)
>
> Any help?
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql