MySQL Forums
Forum List  »  InnoDB

ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint f ails (`trc/nccrop`, CONSTRAINT `NCCrop_ibfk_1` FOREIGN KEY (`NCSId`) REFERENCES `ncsarvey` (`NCSId`))
Posted by: Shashidhar D.M
Date: January 23, 2009 03:11AM

i have an table NCSarvey in this NCSID is a primary key and also,
i have an one more table NCCrop in this NCSId is a foreign key which references
NCSarvey NCSId,
but before inserting a data into NCCRop table , i added a data to the NCSarvey table, but after that also i am getting the below error

ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint f
ails (`trc/nccrop`, CONSTRAINT `NCCrop_ibfk_1` FOREIGN KEY (`NCSId`) REFERENCES
`ncsarvey` (`NCSId`))

plese tell me how to fix it

Options: ReplyQuote


Subject
Views
Written By
Posted
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint f ails (`trc/nccrop`, CONSTRAINT `NCCrop_ibfk_1` FOREIGN KEY (`NCSId`) REFERENCES `ncsarvey` (`NCSId`))
3722
January 23, 2009 03:11AM


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.