简体   繁体   English

Salesforce查询更多红宝石

[英]salesforce queryMore in ruby

I have 50K records and i want to fetch all records in 1000 batch size. 我有5万条记录,我想以1000个批处理大小读取所有记录。 In sql,i do something like limit 1000 offset x but salesforces doesn't allow offset when it is greater than 2000. To overcome this problem, i used this trick 在sql中,我做一些limit 1000 offset x但是Salesforce不允许offset量大于2000时使用。

client.query("
  SELECT Id, Name__c, CreatedDate 
  FROM Product__c WHERE CreatedDate < "First-Returned-Created-Date" 
  ORDER BY CreatedDate DESC 
  LIMIT 1000    
")

and

But i got this error 但是我得到这个错误

Databasedotcom::SalesForceError: Bind variables only allowed in Apex code

So, how to apply offset in salesforce SOQL . 因此,如何在Salesforce SOQL应用offset I am using . 我正在使用 I know about queryMore() method but for whatever reason i don't find any such API in ruby. 我知道关于queryMore()方法,但是由于任何原因,我在ruby中都找不到任何这样的API。 Is there any such API available or something similar which will solve my problem. 有没有这样的API可用或类似的东西可以解决我的问题。

Thanks 谢谢

您可以使用next_page函数,它完全返回queryMore功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM