MySQL Forums
Forum List  »  Newbie

Re: Error - foreign key restraints
Posted by: Pete Rossetti
Date: October 31, 2017 06:24PM

Tried again cleared table setup relation and imported data to invoice table it stoped at 282 and gave the error message below:-


SQL query:

INSERT INTO `Invoice` VALUES ('01135inp14', '28/12/16', '10/12/16', '9.4', 'Renew domain name myliberty.co.uk for 1 yr', '28/12/17', '0', '7', '')



MySQL said:


#1452 - Cannot add or update a child row: a foreign key constraint fails (`cust_invoice`.`invoice`, CONSTRAINT `invoice_ibfk_1` FOREIGN KEY (`_fkCust_Id`) REFERENCES `Customers` (`_pkCust_Id`) ON DELETE NO ACTION ON UPDATE NO ACTION


Not sure what the Create table stmt - do you mean the Sql code to create the table? Am using phpmyadmin to create the Db

Options: ReplyQuote


Subject
Written By
Posted
Re: Error - foreign key restraints
October 31, 2017 06: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.