MySQL Forums
Forum List  »  InnoDB

Re: Cannot add foreign key constraint (1215)
Posted by: Bob Paris
Date: July 18, 2013 02:26PM

Using MySQL Workbench 5.2.47 CE

Created schema dossier with the command: CREATE SCHEMA `dossier` ; then I tried

CREATE TABLE Orders
(
O_Id int NOT NULL,
OrderNo int NOT NULL,
P_Id int,
PRIMARY KEY (O_Id),
FOREIGN KEY (P_Id) REFERENCES Persons(P_Id)
)

and I got : Cannot add foreign key constraint (1215) Why?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Cannot add foreign key constraint (1215)
8690
July 18, 2013 02:26PM


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.