Import CSV requires a certain field

By gversion - September 18, 2013

Hello,

There's something I don't understand with the CSV Import plugin...

I am only able to import listings if I include a column for a field called "condition". Could someone please explain why this may be?

If I don't include the "condition" field then when I try and import I see error messages for every listing and the import won't complete. However, by simply specifying a column in the CSV file for the "condition" field the import works fine.

Is "condition" a reserved word....? Now I think about it I think that may have caused issues somewhere else in my code so perhaps it's a similar issue.

Any insight that can be provided would be very appreciated.

Regards,

Greg

By Jason - September 18, 2013

Hi Greg,

CONDITION is a reserved word for MySQL, but if that was the issue, I would expect to see errors when it was included, instead of excluded.  So, when you skip the condition field, you get an error, but if you assign it to a CMS field, it works correctly, is that right?  Can you let me know what the error message is that you are getting?  What type of field are you mapping it to in the CMS?  What type of values are in that column?

Let me know and we'll see if we can narrow this problem down.

Thanks,

---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By gversion - September 18, 2013

Hi Jason,

Your understanding is correct; when I include the filed the import works fine and if I exclude it then the import fails.

My "condition" field is a dropdown menu field with several options such as:

  • Excellent
  • Good
  • Fair/Working

These options are just setup using the "Set options below" list.

If I exclude the "condition" field then the error message is as follows:

Import Row #1 - MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition = DEFAULT , warranty = DEFAULT , description = DEFAULT , paid_until = ' at line 17
SET `product` = 'product name',
`status` = 'visible',
`list_price` = '100,000.00',
`manufacturer` = 'company_name'

Maybe the "condition" field can not be set to DEFAULT?

Thanks for your help with this.

Regards,

Greg