Feedback
Did this article resolve your question/issue?

   

Article

How to use bulk load tool with Salesforce ?

Information

 
TitleHow to use bulk load tool with Salesforce ?
URL NameHow-to-use-bulk-load-tool-with-Salesforce
Article Number000152011
EnvironmentProduct : Connect for ODBC Salesforce driver
Version : All supported versions
Database : Salesforce
OS : All supported platforms
Application : Bulk.exe
Question/Problem Description
How to export and load data from/in Salesforce ?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution

To export data from Salesforce, run the bulk tool that comes with the Connect for ODBC Driver in the samples\bulk folder.
Run this tool : bulk "DSN=XXX;UID=YYY;PWD=ZZZ"
Select 'Export' and provide requested information.

To load the data in the database, make sure the table does exist in the destination database.
Then, run the bulk tool : bulk "DSN=XXX;UID=YYY;PWD=ZZZ"
Select "Load" and provide requested information.

When loading salesforce data back in salesforce, the below actions must be taken into account :

1. Salesforce does not allow bulk loading of data into the auto-generated ROWID column. As a result, this data needs to be removed from the CSV file that is being used as input since the data in it was created by exporting all the rows from a Salesforce table.
 
The driver’s bulk load table argument has a limitation in that you can only pass just the table name if the input file contains data for ALL the columns in the table. As Salesforce does not allow bulk load into the ROWID field, modify the table name argument so that it contains a column list with ROWID left out. For example : 
account(SYS_NAME, TYPE, PARENTID, BILLINGSTREET, BILLINGCITY, BILLINGSTATE, BILLINGPOSTALCODE, BILLINGCOUNTRY, BILLINGLATITUDE, BILLINGLONGITUDE, SHIPPINGSTREET, SHIPPINGCITY, SHIPPINGSTATE, SHIPPINGPOSTALCODE, SHIPPINGCOUNTRY, SHIPPINGLATITUDE, SHIPPINGLONGITUDE, PHONE, FAX, ACCOUNTNUMBER, WEBSITE, PHOTOURL, SIC, INDUSTRY, ANNUALREVENUE, NUMBEROFEMPLOYEES, OWNERSHIP, TICKERSYMBOL, DESCRIPTION, RATING, SITE, SYS_OWNERID, LASTVIEWEDDATE, LASTREFERENCEDDATE, JIGSAW, JIGSAWCOMPANYID, ACCOUNTSOURCE, SICDESC, CUSTOMERPRIORITY, SLA, ACTIVE, NUMBEROFLOCATIONS, UPSELLOPPORTUNITY, SLASERIALNUMBER, SLAEXPIRATIONDATE)
 
2. The tableName variable in the bulk.c code is too small to hold this value so redefine it and recompile the app:
char       tableName[1024];
 
3. At this point the load will still fail an error indicating that there were invalid column values. Check the .csv file to see if there are no additional and unexpected line endings in it.

4. Edit the file so that all the fields for a single row are on a single line and remove the values for ROWID.

5. Edit the xml for the table definition and remove the ROWID field.
 
6. If the bulk load still fails, look in the Salesforce UI at the MonitoràJobsàBulk Data Load Jobs screen, if an error is captured, like : 
"Id","Success","Created","Error"
"","false","false","INVALID_FIELD_FOR_INSERT_UPDATE:Unable to create/update fields: JigsawCompanyId, LastReferencedDate, PhotoUrl, LastViewedDate. Please check the security settings of this field and verify that it is read/write for your profile or permission set.:JigsawCompanyId LastReferencedDate PhotoUrl LastViewedDate --"
 
So there are now some fields in the data that are not allowed to be in the bulk insert. Modify the input CSV and XML files and tableName(columnList) value used in the bulk load sample to exclude these fields.

 

Workaround
Notes
Last Modified Date8/3/2016 2:01 PM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.