Re: compound foreign key(s)

2005-10-15 Thread Gleb Paharenko
Hello.



Please, send the output of the following statements:



SHOW CREATE TABLE country;

SHOW CREATE TABLE lang;



Include the CREATE statement for countrylang table and exact error number.





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? 

> 

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: compound foreign key(s)

2005-10-13 Thread Ady Wicaksono

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
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



compound foreign key(s)

2005-10-13 Thread Guy Brom

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
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]