function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PSS_BSBPSS_BSB 

I need an example of an Update from the command line Dataloader.

Hello,

 

I already have a process for extracting salesforce tables into SQL nightly. I am now trying to update salesforce from my SQL database and I can't find a single example.

 

My latest test attempt looks like this:

 

database-conf.xml

 

<bean id="databaseUpdateVOD"
      class="com.salesforce.lexiloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="databaseUpdateVODSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>

<bean id="databaseUpdateVODSql"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            SELECT Id, Credentials_vod__c from Biovail_Salesforce_Com..Account 

        </value>
    </property>
    <property name="sqlParams">
        <map>
<entry key="Id"   value="java.lang.String"/>
<entry key="Credentials_vod__c"   value="java.lang.String"/>
        </map>
    </property>
</bean>

 

process-conf.xml

 

    <bean id="databaseUpdateVODProcess"
          class="com.salesforce.lexiloader.process.ProcessRunner"
          singleton="false">
        <description>databaseUpdateVOD job updates account info into salesforce info from database."</description>
        <property name="name" value="databaseUpdateVOD"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Account"/>
                <entry key="sfdc.externalIdField" value="Id"/>
                <entry key="sfdc.extractionRequestSize" value="500"/>
                <entry key="process.operation" value="update"/>
                <entry key="process.mappingFile" value="C:\VOD\accountExtractMap.sdl"/>
                <entry key="process.outputError" value="C:\VOD\accountErrors.csv"/>
                <entry key="process.outputSuccess" value="C:\VOD\accountSuccess.csv"/>
                <entry key="dataAccess.type" value="databaseRead"/>
                <entry key="dataAccess.name" value="databaseUpdateVOD"/>
            </map>
        </property>
    </bean>

 

What am I missing?

Best Answer chosen by Admin (Salesforce Developers) 
PSS_BSBPSS_BSB

OK, I finally got this to work.

 

I had to remove my sqlparams and change it to a columnNames.

 

I tried this before but the example given by salesforce uses ColumNames and not ColumnNames.

 

Since that was an invalid property name and the first column was ID it gave me the blnak ID error.

 

This is solved now.

 

I just need to replicate this for all update processes for all clients.

All Answers

HarmpieHarmpie

First of all the query looks a bit odd to me (..) : SELECT Id, Credentials_vod__c from Biovail_Salesforce_Com..Account 

 

You will probably receive an error on this when you run the process from a commandline (e.g. process c:\SForce\DlConfig\dataloader\ upsertAccounts for the example below)

 

Below is a working example, but this 1 reads from a CSV.  What's missing in your process definition is at least a username and password for Salesforce. But again, these types of errors will be displayed when you run a process in a command shell.

 

<bean id="upsertAccounts" class="com.salesforce.lexiloader.process.ProcessRunner" singleton="false"> <description>Upserts the Account export</description> <property name="name" value="upsertAccounts"/> <property name="configOverrideMap"> <map> <entry key="sfdc.debugMessages" value="false"/> <entry key="sfdc.debugMessagesFile" value="C:\SForce\DlConfig\logfiles\upsertAccounts.log"/> <entry key="sfdc.endpoint" value="https://www.salesforce.com"/> <entry key="sfdc.username" value="user@somedomain.com"/> <entry key="sfdc.password" value="encryptedpassword"/> <entry key="process.encryptionKeyFile" value="C:\SForce\DlConfig\dataloader\pkey.key"/> <entry key="process.outputError" value="C:\SForce\DlConfig\logfiles\upsertAccounts.error.csv"/> <entry key="process.outputSuccess" value="C:\SForce\DlConfig\logfiles\upsertAccounts.success.csv"/> <entry key="sfdc.timeoutSecs" value="600"/> <entry key="sfdc.loadBatchSize" value="200"/> <entry key="sfdc.externalIdField" value="Some_External_Id_Field__c"/> <entry key="sfdc.entity" value="Account"/> <entry key="process.operation" value="upsert"/> <entry key="process.mappingFile" value="C:\SForce\DlConfig\mappings\account.sdl"/> <entry key="dataAccess.name" value="C:\SForce\In\ACCOUNT.csv"/> <entry key="dataAccess.type" value="csvRead"/> </map> </property> </bean>

 

 

 

 

 

PSS_BSBPSS_BSB

I omitted the username and password.

 

Thanks for your advise. I got the csv version of the update to work. I want the database version to work. This confirms that my issue is with my database-conf.xml and not process-conf.xml

 

I still need help there.

PSS_BSBPSS_BSB

OK, I finally got this to work.

 

I had to remove my sqlparams and change it to a columnNames.

 

I tried this before but the example given by salesforce uses ColumNames and not ColumnNames.

 

Since that was an invalid property name and the first column was ID it gave me the blnak ID error.

 

This is solved now.

 

I just need to replicate this for all update processes for all clients.

This was selected as the best answer