Luis,

a sneak peek of MySQL-4.0.13:

mysql> show innodb status;

...

------------------------
LATEST FOREIGN KEY ERROR
------------------------
030324 16:14:01 Error in foreign key constraint of table test/tab3:
There is no index in the table test/tab3 where the columns appear
as the first columns. Constraint:
FOREIGN KEY (cod2) REFERENCES tab2(cod2)
ON UPDATE CASCADE ON DELETE CASCADE)TYPE=INNODB
See http://www.innodb.com/ibman.html for correct foreign key definition.

This explains the error.

Best regards,

Heikki
Innobase Oy
http://www.innodb.com
InnoDB - transactions, foreign keys, and a hot backup tool for MySQL

sql query


----- Original Message -----
From: "Luis Matos Lima" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 24, 2003 6:24 PM
Subject: Question


> i already sent my question to [EMAIL PROTECTED],
> but i have no response, that's why i sent this message
> to you. This is the error that appear:
>
> CREATE TABLE tab3(
> cod1 int( 3 ) NOT NULL ,
> cod2 int( 3 ) NOT NULL ,
> PRIMARY KEY ( cod1, cod2 ) ,
> FOREIGN KEY ( cod1 ) REFERENCES tab1( cod1 ) ON UPDATE
> CASCADE ON DELETE CASCADE ,
> FOREIGN KEY ( cod2 ) REFERENCES tab2( cod2 ) ON UPDATE
> CASCADE ON DELETE CASCADE
> ) TYPE = INNODB
>
> Mensagens do MySQL :
> Can't create table '.\test\tab3.frm' (errno: 150)
>
>
> -------------------------------------------------
> Email Enviado utilizando o serviço MegaMail


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

Reply via email to