Akhil Jain
Akhil Jain

Reputation: 23

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

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 ?

Upvotes: 0

Views: 7660

Answers (2)

Edgar Rios
Edgar Rios

Reputation: 21

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

Upvotes: 2

bruceyyy
bruceyyy

Reputation: 439

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

Upvotes: 1

Related Questions