MySQL Forums
Forum List  »  InnoDB

Re: Referential Integety behavior not working.
Posted by: Yoshiaki Tajika
Date: February 01, 2006 08:24PM

Is `parent` table empty?

If it already has a record where parent_id = 2,
the insert statement into `child` will succeed.

What I mean is... you maybe want to define the foreign key constraint
like this, don't you?

FOREIGN KEY (parent_id) REFERENCES parent(parent_id)
/* not FOREIGN KEY (id) REFERENCES parent(parent_id) */

Options: ReplyQuote


Subject
Views
Written By
Posted
2037
February 01, 2006 01:10PM
Re: Referential Integety behavior not working.
1337
February 01, 2006 08:24PM


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.