function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
zeezackisbackzeezackisback 

Limited Queries?

I run the query

 

SELECT Id,LastName,FirstName FROM Account

 

and only about a 1000 records are called?

 

Why is this.. I need to call all of them. Is there a way of leap frogging in soql?

 

 

SELECT Id,LastName,FirstName FROM Account LIMIT 10,200

and find the number of rows in the query?

Best Answer chosen by Admin (Salesforce Developers) 
ptepperptepper

I'm guessing from the dollar sign that you're using PHP. There are good examples on how to do this here:

http://wiki.developerforce.com/index.php/PHP_Toolkit_13.0_Samples

 

Enterprise

http://wiki.developerforce.com/index.php/PHP_Toolkit_13.0_QueryMore_Sample_(Enterprise)

 

Partner

http://wiki.developerforce.com/index.php/PHP_Toolkit_13.0_QueryMore_Sample_(Partner)

Message Edited by ptepper on 04-29-2009 12:10 PM

All Answers

SuperfellSuperfell
you need to use queryMore to keep fetching chunks of the results until you've got them all.
zeezackisbackzeezackisback
Is there a limit to queryMore?
SuperfellSuperfell
No, you keep calling queryMore until you've got the entire result set.
zeezackisbackzeezackisback
Thank you for the information Simon. Is there an example of this in action. Also why is salesforce written like this, this due to its oracle backend?
SuperfellSuperfell
See the API docs for examples. What if you have 10M accounts, each with 500 fields, you really want to fetch all that data in one round trip?
zeezackisbackzeezackisback

Dear Simon,

 

$options = new QueryOptions(200); 

 

 

Am I right in saying that  QueryOptions(200);

sets a jump of 200 records per leap?

 

so its like LIMIT 0,200 

 

then  LIMIT 201, 400

 

etc...etc..

 

second question - is this considered ALL one call to salesforce... or is it multiple calls?

ptepperptepper

I'm guessing from the dollar sign that you're using PHP. There are good examples on how to do this here:

http://wiki.developerforce.com/index.php/PHP_Toolkit_13.0_Samples

 

Enterprise

http://wiki.developerforce.com/index.php/PHP_Toolkit_13.0_QueryMore_Sample_(Enterprise)

 

Partner

http://wiki.developerforce.com/index.php/PHP_Toolkit_13.0_QueryMore_Sample_(Partner)

Message Edited by ptepper on 04-29-2009 12:10 PM
This was selected as the best answer