0

While i am trying to import taxonomies with this structure:

name,guid,parent_name,parent_guid
Primary Energy,32001,,
Transformation,32002,,
Final Energy,32003,,
Electricity,32004,Transformation,32002
Generation efficiency,32005,Electricity,32004
Installed capacity,32006,Electricity,32004
Heat,32007,Transformation,32002

I am getting this error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1018-0' for key 'PRIMARY'
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1019-0' for key 'PRIMARY'
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1020-0' for key 'PRIMARY'
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1022-1021' for key 'PRIMARY'
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1023-1021' for key 'PRIMARY'

is there any thing wrong with structure of the CSV file & values inside it ?

  • Does the error not give you enough information? Duplicate entry '1018-0' for key 'PRIMARY' seems to explain it all. The primary key must be unique but maybe yours are not unique? Without seeing the rest of the csv I can only speculate on this ofcourse – 2pha Mar 17 '14 at 5:44
  • Of course i know the meaning of duplicate Primary Key, but what i am wondering about why the feeds module when importing taxonomies gives this error, so it should be something wrong with my CSV structure & my question is more concerned about how to use the GUID & the parent GUID in importing taxonomies. – mohamad salama Mar 17 '14 at 8:35
  • I have never imported multi level taxonomies the way you are trying. I have only done it in a "parent term>>child term" structure. If you are able to get your CSV in this sructure, you will be able to use the feeds tamper module along with the module I have posted in comment #40 at: drupal.org/node/1319278#comment-6967716 – 2pha Mar 17 '14 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.