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
cpatelcpatel 

Read a large number of rows

What is the best way to read a large number of rows? RIght now i am using the REST API query. e.g. q='Select Id from Account'

Then i am iterating through the ids and getting each row separately.

SuperfellSuperfell

Why don't you just query the fields you want when doing the query, instead of making a round trip for each row ?

cpatelcpatel

We need all the fields so thats why i'm readin the whole row. I understand that SOQL does not support a Select * ?

SuperfellSuperfell

It doesn't support select *, but you can build a soql query with all the fields in. (use the describe resources if needed) you don't want to fetch a large number of rows by getting them one at a time, it'll be horribly slow, and it'll burn through your api call allocation very quickly