SQL Configuration
When running Data Loader in batch mode from the command line, the SqlConfig class contains configuration parameters for accessing specific data in the database.
| Required Editions |
|---|
| Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer editions |
The Data Loader command-line interface is supported for Windows only.
As shown in these code samples, queries and inserts are different but very similar. The bean must be of type com.salesforce.dataloader.dao.database.SqlConfig and have these properties.
-
sqlStringThe SQL code to be used by the data access object.
The SQL can contain replacement parameters that make the string dependent on configuration or operation variables. Replacement parameters must be delimited on both sides by “@” characters. For example,
@process.lastRunDate@. -
sqlParamsA property of type
mapthat contains descriptions of the replacement parameters specified insqlString. Each entry represents one replacement parameter: the key is the replacement parameter’s name, the value is the fully qualified Java type to be used when the parameter is set on the SQL statement. Note that “java.sql” types are sometimes required, such asjava.sql.Dateinstead ofjava.util.Date. For more information, see the official JDBC API documentation. -
columnNamesUsed when queries (
SELECTstatements) return a JDBCResultSet. Contains column names for the data outputted by executing the SQL. The column names are used to access and return the output to the caller of theDataReaderinterface.