MySQL Forums
Forum List  »  InnoDB

Re: adding forign key
Posted by: Diego Mitch
Date: February 16, 2007 03:48PM

I dont know if it is your case, but i found a similar problem when:

I HAD THREE TABLES:
1) MARK (COLUMNS = MARKCODE, MARKNAME)
2) MODELS (COLUMNS = MARKCODE, MODELCODE, MODELNAME)
3) TRANSACTIONS. (COLUMNS = NUMBERTRANSACTION, MARKCODE, MODELCODE, QUANTITY)

MODELS HAD A FOREIGN KEY (MARKCODE) POINTING TO MARK

I TRIED TO ADD TWO FOREIGN KEYS (MARKCODE AND MODELCODE) TO TRANSACTIONS POINTING TO MARK AND MODELS. I COULDNT WHY?

SIMPLE BECAUSE I HAD ALREADY USED THE TABLE TRANSACTIONS AND COPY IN IT SOME VALUES OF MARKCODE AND MODELCODE, THAT AFTERWARDS THEY WERE ALREADY DELETED IN THE MARK TABLE AND MODEL TABLE SO THE FOREIGN KEY IN THESE ROWS COULD NOT MATCH ANY VALUE IN THE OTHER TWO TABLES.

Options: ReplyQuote


Subject
Views
Written By
Posted
7307
December 29, 2006 07:47AM
3321
January 04, 2007 12:54PM
Re: adding forign key
3285
February 16, 2007 03:48PM


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.