ERROR 1452: Cannot add or update a child row: a foreign key constraint fails

后端 未结 21 2140
野性不改
野性不改 2020-11-22 07:01

I have created tables in MySQL Workbench as shown below :

ORDRE table:

CREATE TABLE Ordre (
  OrdreID   INT NOT NULL,
  OrdreDato DA         


        
21条回答
  •  不知归路
    2020-11-22 07:39

    While inserting the foreign key attribute values, first verify the attributes type, as well as primary key attribute value in the parent relation, if the values in parent relation matches, then you can easily insert/update child attribute values.

提交回复
热议问题