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) »
  • Sample SQL Import
Pages: [1]

Author Topic: Sample SQL Import  (Read 919 times)

Keith

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Sample SQL Import
August 05, 2010, 07:04:42 pm
I am new at civiCRM but have some experience with mysql.

I have looked everywhere for a sample mysql import script. Can anyone point me to some documentation?

All I am doing is importing contacts with some custom fields.

Thanks.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Sample SQL Import
August 06, 2010, 11:16:50 am
You should add tables that you want to import to CiviCRM db. Then use normal sql select during import.

Quote
SQL Query must be a SELECT query that returns one or more rows of data to be imported. Specify the database name(s) AND table name(s) in the query (e.g. "SELECT * FROM my_database.my_table WHERE date_entered BETWEEN '1999-01-01' AND '2000-07-31'").

HTh

Kurund
Found this reply helpful? Support CiviCRM

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Sample SQL Import
August 06, 2010, 03:11:39 pm
This blog post describes a custom import script - might be of interest if Kurund's approach isn't viable for some reason.

http://civicrm.org/blogs/admin/writing-custom-import-script
Protect your investment in CiviCRM by  becoming a Member!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Sample SQL Import
August 06, 2010, 03:21:32 pm
Or read the chapter on data import

http://en.flossmanuals.net/CiviCRM/DevelopImport
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Sample SQL Import

This forum was archived on 2017-11-26.