- February 12, 2018 at 10:04 am #25225Ankit #18
Difference between database.query() and database.getQueryLocator() in Salesforce?
Difference between database.query() and database.getQueryLocator() in Salesforce?February 12, 2018 at 11:58 am #25227PRANAV #2
database.query allows you to make a dynamic SOQL query at runtime. You can build up a string and then use that as a query string at run time in the database.query statement to make a SOQL call that is determined at run time.
database.getQueryLocator returns a Query Locator that runs your selected SOQL query returning list that can be iterated over in batch apex or used for displaying large sets in VF (allowing things such as pagination).
Hope this helps you.
Please Register to reply to this topic. /