+ Start a Discussion
sampathawaduge sameerasampathawaduge sameera 

What is the advantage of querying within loop?

what is the advantages of querying data withing the for loop itself like below

for(Account a:[select name from Account])
{
***logic***
}
Best Answer chosen by sampathawaduge sameera

All Answers

Raj VakatiRaj Vakati
It's going to reduce the heap size. Its one of the technique to reduce the heap size 
<Saket><Saket>
Raj V awesome 👌
sfdcMonkey.comsfdcMonkey.com
This was selected as the best answer