MySQL Forums
Forum List  »  Newbie

Add referential integrity
Posted by: Alan Honeyman
Date: August 01, 2015 12:26AM

mySQL 5.5 WIN7

In this existing system, there is a master table ("MAST") with this column:

docnumber INT(10) null=NO key=PRI auto-increment

and another table ("DETAIL") which contains docnumber as MULTI - many records can have this key, each having a different "PAGENUMBER" column.

So, there is an implied one to many relationship between MAST and DETAIL but I need ensure that each record added to DETAIL has a matching MAST docnumber.

Can I update DETAIL to enforce this? Foreign-Key?

Options: ReplyQuote


Subject
Written By
Posted
Add referential integrity
August 01, 2015 12:26AM


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.