You need to sign in to do that
Don't have an account?
eblazer
Data Loader: Command Line w/ SQL & "@" Characters
Hello,
I'm using Data Loader 11.0 from the command line. Is there a proper escape sequence for "@" characters within SQL statements to keep Data Loader from interpreting them as variables?
For example:
SELECT 'eblazer@somewhere.com' AS emailaddress, accountid FROM contacts
The above is perfectly valid SQL, however Data Loader encounters the "@" symbol and does something to break the SQL and a JDBC exception is thrown.
As a temporary work around, i've been changing the SQL as follows:
SELECT 'eblazer' + char(64) + 'somewhere.com' AS emailaddress, accountid FROM contacts
Thanks,
Eddie
I'm using Data Loader 11.0 from the command line. Is there a proper escape sequence for "@" characters within SQL statements to keep Data Loader from interpreting them as variables?
For example:
SELECT 'eblazer@somewhere.com' AS emailaddress, accountid FROM contacts
The above is perfectly valid SQL, however Data Loader encounters the "@" symbol and does something to break the SQL and a JDBC exception is thrown.
As a temporary work around, i've been changing the SQL as follows:
SELECT 'eblazer' + char(64) + 'somewhere.com' AS emailaddress, accountid FROM contacts
Thanks,
Eddie
Select Name , AccountId , Email From Contact WHERE email='dinesh.nasipuri@gmail.com'
I think this will help you.
Thanks and Regards,
Dinesh Nasipuri
dinesh.nasipuri@gmail.com
I think you might be mis-understanding the scenario. Using DataLoader's command line interface (aka "Running in Batch Mode"), you can send a SQL (not SOQL!) statement to any JDBC-compatible database. DataLoader will retrieve the result set, parse it, and insert/upsert/update the data to Salesforce.com.
Before executing the SQL statement, DataLoader can search for, and replace, variables within the SQL statement. These variables are denoted with an @ symbol. Example:
SELECT Id, FirstName, LastName
FROM MyContacts
WHERE InsertDate > @process.lastRunDate@
Will retrieve all contacts (from my JDBC database) inserted into "MyContacts" since the last time the DataLoader batch process has been executed, and then insert/upsert/update into Salesforce.com.
My problem occurs when I need to execute a SQL statement that has a legitimate "@" symbol in the SQL. Example:
SELECT Id, FirstName, LastName, 'eblazer@somewhere.com' AS Email
FROM MyContacts
DataLoader encounters the "@" in "eblazer@somewhere.com", thinks it's a variable, and for some reason after realizing it's not a valid variable strips the "@somewhere.com" thereby making the SQL Statement invalid and throwing an exception.
I'd like to know if there is a way to 'escape' the @ symbol to keep dataloader from parsing it as a variable.
Thanks.
Take a look at the data loader user guide, p23 it explains how the replacement parameters can be used.
I am not quite sure what you are ultimately trying to do, the example you provided is legite in SQL, but you have to use SOQL when using the dataloader.
Your example:
SELECT 'eblazer@somewhere.com' AS emailaddress, AccountId From Contact
Simply states that you want to provide a default value, if that is actaully what you want to do, you can to that in a mapping file.
Hope that helps.