+ Start a Discussion
patrospatros 

DataLoader : Can sfdc.extractionSOQL be passed as command line parameter?

I can't seem to pass the sfdc.extractionSOQL property as a parameter on the command line when running the data loader. Other parameters work fine. Is sfdc.extractionSOQL not passable, or is my syntax just off? See my attempts below

 

This works (excluding sfdc.extractionSOQL):

_jvm\bin\java.exe -cp DataLoader.jar;"c:\integration\sqljdbc.jar" -Dsalesforce.config.dir=conf com.salesforce.lexiloader.process.ProcessRunner process.name=SalesforceContactToDB

 

This doesn't (tried to put quotes around it):

_jvm\bin\java.exe -cp DataLoader.jar;"c:\integration\sqljdbc.jar" -Dsalesforce.config.dir=conf com.salesforce.lexiloader.process.ProcessRunner process.name=SalesforceContactToDB sfdc.extractionSOQL="SELECT ID, FIRSTNAME, LASTNAME, EMAIL, PHONE, TESTVALUE__C FROM CONTACT WHERE TESTVALUE__C = 1"

 

Nor this (no quotes):

_jvm\bin\java.exe -cp DataLoader.jar;"c:\integration\sqljdbc.jar" -Dsalesforce.config.dir=conf com.salesforce.lexiloader.process.ProcessRunner process.name=SalesforceContactToDB sfdc.extractionSOQL=SELECT ID, FIRSTNAME, LASTNAME, EMAIL, PHONE, TESTVALUE__C FROM CONTACT WHERE TESTVALUE__C = 1

 

 

 Nor this (escape spaces):

_jvm\bin\java.exe -cp DataLoader.jar;"c:\integration\sqljdbc.jar" -Dsalesforce.config.dir=conf com.salesforce.lexiloader.process.ProcessRunner process.name=SalesforceContactToDB sfdc.extractionSOQL=SELECT\ ID,\ FIRSTNAME,\ LASTNAME,\ EMAIL,\ PHONE,\ TESTVALUE__C\ FROM\ CONTACT\ WHERE\ TESTVALUE__C\ \=\ 1

 

 

Thanks!

Message Edited by patros on 09-18-2009 02:08 PM
Message Edited by patros on 09-18-2009 02:09 PM
nitin78nitin78
How did you fix this? I have the same problem
richwintlerichwintle

I have this issue but it seems to be '=' in the 'where' clause which is causing the error. It needs to be escaped somehow. If you need !=, use <> instead, that seems to work.

 

Anyone help with this?

DaveWaveDaveWave

Thanks for the clue of the '=' sign being the culprit. You saved me a lot of time.  The equal sign was causing my query not to overide the bean definition in the data loader config file.

 

I found a workaround that can be used to avoid the '=' in the SOQL.

 

The following query was not overriding the config file:

 

sfdc.extractionSOQL="select Id from Account where isPersonAccount = TRUE limit 1"

 

The following workaround allowed me to override the config file:

 

sfdc.extractionSOQL="select Id from Account where isPersonAccount in(TRUE) limit 1"

 

The "in" keyword solved the problem!

Ivan@LM__hIvan@LM__h

When I try passing sfdc:extractionsoql as parameter; in log file I get - query string was empty message. Any clues ?

JustindevJustindev

You are correct '=' is the hell here, Thanks for your post...

Andrew RoweAndrew Rowe
Fortunate to have found this post.  I have a very lengthy query with a complex WHERE clause.
Not only was there no readily available way to escape out the equals sign, the other operators were having issues.
Switching the = to IN() was a good alternative.  The LIKE statements will require double %% and other operators
like < and > work when you escape them out with carats...
> becomes ^>
< becomes ^<

If you have a >=, just change your values to convert it to > and escape it out ^>