CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Error on Import (New - not seen in the forums)
Pages: [1]

Author Topic: Error on Import (New - not seen in the forums)  (Read 4195 times)

erich_prinz

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Error on Import (New - not seen in the forums)
July 16, 2009, 07:50:42 pm
PHP 5.x.x
MySQL 5.x
Apache2
Joomla 1.5.11
civiCRM 2.2.7

When attempting to import from CSV file after setup screen, this error occurs.

Database Error Code: 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 ') ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci' at line 1, 1064

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => CREATE TABLE civicrm_import_job_a1894a65042a7788b423036d0b9af6c2 ( text) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1064 ** 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 ') ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci' at line 1]
    [type] => DB_Error
    [user_info] => CREATE TABLE civicrm_import_job_a1894a65042a7788b423036d0b9af6c2 ( text) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1064 ** 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 ') ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci' at line 1]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TABLE civicrm_import_job_a1894a65042a7788b423036d0b9af6c2 ( text) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1064 ** 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 ') ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci' at line 1]"]
)

Please advise!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error on Import (New - not seen in the forums)
July 16, 2009, 09:25:08 pm

can you reproduce on drupal.demo.civicrm.org

if so, can you please attach a scrubbed version of your csv file here

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

erich_prinz

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Error on Import (New - not seen in the forums)
July 17, 2009, 12:08:26 pm
Quote from: Donald Lobo on July 16, 2009, 09:25:08 pm

can you reproduce on drupal.demo.civicrm.org

if so, can you please attach a scrubbed version of your csv file here

thanx

lobo



Yes, the same error occurs in the demo site.

For some reason, I'm unable to upload the file here.

Here is the file for download ... http://files.me.com/prinz/7sw2wc

« Last Edit: July 17, 2009, 12:13:12 pm by erich_prinz »

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: Error on Import (New - not seen in the forums)
July 21, 2009, 10:08:38 am
I had a fairly similar error importing from SQL data source in Civi 2.2.6, using any SQL query I tried. I verified that the SQL query contained the db name & runs successfully from mysql command line as the Civi db user.

E.g. SQL query:
Code: [Select]
SELECT Organisation, OrgEmail FROM mydb.tblOrganisations
Error:
Code: [Select]
CREATE TABLE civicrm_import_job_5d6ccdd653eedf587debb350713a77cb SELECT Organisation, OrgEmail FROM mydb.tblOrganisations ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1064 ** 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 '=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci' at line 1]
In my case upgrading from 2.2.6 to 2.2.7 fixed the issue. (When I first posted this I thought the site in question was on 2.2.7 - post edited accordingly & is less relevant to the OP's issue, as he's on 2.2.7).

Dave J
« Last Edit: July 21, 2009, 10:31:06 am by davej »

erich_prinz

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Error on Import (New - not seen in the forums)
July 21, 2009, 02:01:47 pm
Right. For the record, this install is 2.2.7.

The link for the scrubbed csv is time bombed. Have you grabbed this file yet Lobo?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Error on Import (New - not seen in the forums)
July 21, 2009, 03:14:11 pm
Hmm... I grabbed the file and tested through step 2 Import Contacts on our public demo, and did not get any errors. (http://drupal.demo.civicrm.org/civicrm/import/contact?reset=1)

The Map Fields (step 2) screen comes up as expected with column headers and data values. I chose the closest date format to the one in your file:

[ x ] mm/dd/yy OR mm-dd-yy (12/25/98 OR 12-25-98) OR (9/1/08 OR 9-1-08)

That said, this file doesn't have required contact data fields in it (maybe because you "scrubbed" those out)? Contact import requires either First and Last Name OR Email for individual contact records. Also, the Training Date column is formatted mm/dd/yy hh:mm (9/18/01 0:00) - and I'm pretty sure we don't support date + time formats. However you may not be planning on importing that field (or possibly to a custom field??).

So possibly you tested on demo with a different file or different steps or ?? We'd need more details on how to recreate on demo, where it breaks down, and the exact error message you get on demo.
Protect your investment in CiviCRM by  becoming a Member!

erich_prinz

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Error on Import (New - not seen in the forums)
July 22, 2009, 12:59:08 pm
Maybe it's an issue with my workstation. If the problem occurs on the install I'm working with AND the demo yet you were able to move to step two, I'd think the error is likely local and not with civiCRM.

I'll test from a different machine and let you know.

erich_prinz

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Error on Import (New - not seen in the forums)
July 22, 2009, 04:37:49 pm
Okay .. found the issue.

The exported csv file was damaged. It showed as a 0 Kb file and of course, will not work.

The sample was pulled from the original spreadsheet. Odd that a zero Kb would produce errors like that - perhaps due to it being corrupt.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Error on Import (New - not seen in the forums)

This forum was archived on 2017-11-26.