本文介绍了带命令行的顶点数据加载器中的关键提取 SOQL 值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用命令行顶点数据加载器.我想提取那些 last_ax_date 字段值大于数据加载器机器上某处指定的日期的帐户.

I am using command line apex data loader. I want to extract those accounts which have last_ax_date field value greater then date specified in the somewhere on data loader machine.

<bean id="ExtractAXAccounts"  class="com.salesforce.dataloader.process.ProcessRunner"
      singleton="false">
    <property name="configOverrideMap"><map>
        <entry key="process.operation" value="extract" />
        <entry key="dataAccess.type" value="csvWrite" />
        <entry key="sfdc.extractionSOQL" value="select Id, Name, Last_AX_Date from  Account  where Last_AX_Date greater then 'date store in somewhere in the system'" />
    </map></property>
</bean>

根据上述情况,我想动态提取帐户.那么我必须在何处指定日期以及如何将其用于sfdc.extractionSOQL"值.

as per the above case I want to extract accounts dynamically. so how where I have to specify date and how I can use it for "sfdc.extractionSOQL" value.

推荐答案

我认为不可能只为 sfdc.extractionSOQL 的一部分传入一个值,但你可以通过在执行 DataLoader.jar 的脚本的整个查询中.这将允许您在从命令行执行时传入日期值.请记住,如果不对 Data Loader 附带的 process.bat 文件进行一些修改,这是不可能实现的,因此这里有一个直接调用 DataLoader.jar 的解决方案:

I don't believe it is possible to pass in a value for only a portion of sfdc.extractionSOQL, but you can pass in the entire query from the script that executes DataLoader.jar. This would allow you to pass in a date value when executing from the command line. Keep in mind that this isn't possible without making a few modifications to the process.bat file that comes with Data Loader, so here's a solution that calls DataLoader.jar directly:

process-conf.xml(将 sfdc.extractionSOQL 排除在声明之外):

process-conf.xml (leaving sfdc.extractionSOQL out of the declaration):

<bean id="ExtractAXAccounts"  class="com.salesforce.dataloader.process.ProcessRunner"
    singleton="false">
    <property name="configOverrideMap"><map>
        <entry key="process.operation" value="extract" />
        <entry key="dataAccess.type" value="csvWrite" />
    </map></property>
</bean>

runDL.bat(将 sfdc.extractionSOQL 作为参数传入 DataLoader.jar):

runDL.bat (which passes in sfdc.extractionSOQL as an argument to DataLoader.jar):

set classpath=C:\salesforce\dataloader\lib\DataLoader.jar
set mainclass=com.salesforce.dataloader.process.ProcessRunner
set confdir=C:\salesforce\dataloader\conf

if [%1]==[]  goto error

call java -cp %classpath% -Dsalesforce.config.dir=%confdir% %mainclass% process.name=ExtractAXAccounts sfdc.extractionSOQL="select Id, Name, Last_AX_Date from  Account where Last_AX_Date > %1"
goto end

:error
echo Error: missing date argument (must be in 'yyyy-mm-ddThh:mm:ssZ' format)
:end

然后您可以从命令行调用 runDL 2012-01-01T00:00:00Z 以提取 Last_AX_Date 大于 01/01/12 的所有记录.

You can then call runDL 2012-01-01T00:00:00Z from the command line to extract all records with a Last_AX_Date greater than 01/01/12.

这篇关于带命令行的顶点数据加载器中的关键提取 SOQL 值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 02:47