Re: Oracle 8.1.7 to MySQL: problem with SP and sequences
Posted by: Philip Busch
Date: August 23, 2005 05:25AM

Hi Mike,

today I've been playing with problem 2 and located the error:

according to the docs, errno 150 represents errors concerning FOREIGN KEY constraints, so I looked for FOREIGN KEY definitions in referencing and referenced tables.

There are (at least) two types of this error that prevent table creation:

-- 2.1 --
"In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order."
(from http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html)

-- 2.2 --
"In the referenced table, there must be an index where the referenced columns are listed as the first columns in the same order. "
(from http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html)


In both cases, a missing or incomplete or malformed INDEX prevents table creation (malformed meaning "foreign key columns are not the first columns of the INDEX" or "foreign key columns in INDEX not in the same order as in FOREIGN KEY definition").

I think it would already be a great advantage if the MT would automatically add an appropriate INDEX to all referenced tables.

I'll post an example of an invalid combination of referencing/referenced table CREATE definitions this afternoon.

Greets,
Philip

Options: ReplyQuote


Subject
Written By
Posted
Re: Oracle 8.1.7 to MySQL: problem with SP and sequences
August 23, 2005 05:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.