MySQL Forums
Forum List  »  InnoDB

Re: Foreign Key constraint problem while using InnoDB
Posted by: Vinod Sugur
Date: August 04, 2009 01:21AM

Hi Aayush,

The below statement is wrong:

ALTER TABLE DATASOURCE_DOCUMENTS ADD FOREIGN KEY(APPUSAGE_ID) REFERENCES DATASOURCE_COLLECTIONS(COLLECTION_NAME,APPUSAGE_ID);

a. One column of DATASOURCE_DOCUMENTS table is mapped with two columns of DATASOURCE_COLLECTIONS table.

b. The foreign key column/columns should map to appropriate primary key column/columns.



Let me know if this helps.

Regards,
Vinod

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Foreign Key constraint problem while using InnoDB
1920
August 04, 2009 01:21AM


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.