SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row

7.7k views Asked by At

This error show every..*.**please help me for the exact answer for this qyery...

SQLSTATE[23000]: Integrity constraint violation: 1452

Cannot add or update a child row: a foreign key constraint fails (mydawai.cataloginventory_stock_item, CONSTRAINT FK_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (product_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CA)

i'm importing the 20 to 50 thousand csv product they will show an error but if part into the 500 hundred -500 hundred list than some of the product will be importing and someone showing error of sql 23000. Integrity constraint violation: 1452 ?

2

There are 2 answers

6
bruceyyy On BEST ANSWER

its means that there is a foreign key that is not satisfied (ie you need it to exist but it doesnt)

catalog_product_entity must have and entry for entity_id which is then referenced as product_id in cataloginventory_stock_item. enter image description here

2
Edgar Rios On

You need to remove any special chacarter in your Csv File. like ©, '', º Thats works for me !