[英]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 databasedotcom-gem . 我正在使用databasedotcom-gem 。 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.