Contents
What does Database QueryLocator do?
Represents the record set returned by Database. getQueryLocator and used with Batch Apex.
What is the transaction limit for the number of records using query locator?
There’s also a limit on the cumulative number of operations that can be made across namespaces in a transaction. This cumulative limit is 11 times the per-namespace limit. For example, if the per-namespace limit for SOQL queries is 100, a single transaction can perform up to 1,100 SOQL queries.
What is difference between Database query and Database QueryLocator?
Database. getQueryLocator() returns a Query Locator that runs the selected SOQL query returning list that can be iterated over in batch apex and Visualforce page. We can retrieve up to 10,000 records. We can’t use getQueryLocator with any query that contains an aggregate function.
How to access children retrieved using a querylocator?
Also how do you access the children retrieved using a QueryLocator like so (it’s a relationship query): Database.getQuerylocator ( [select Id, Name, (select Name from Account) from Contact]); Thanks in advance. Here is a link to the short doc on QueryLocator object. The children records can be accessed in the execute method of Batch Apex.
When to use querylocator to bypass Governor limit?
Use the Database.QueryLocator object when you are using a simple query (SELECT) to generate the scope of objects used in the batch job. If you use a querylocator object, the governor limit for the total number of records retrieved by SOQL queries is bypassed.
How does a querylocator work in Salesforce.com?
So the initial query response returned the first 2000 rows, the queryLocators is aware to return rows 2001-4000 on the corresponding QueryMore () call , and so on. Its just a server side cursor or pointer to the next set of data to return in the queryMore call.
What kind of object is a querylocator?
What is a QueryLocator?! I cannot find anything neither in the documentation nor on the web that answers my question. It is used throughout the batch Apex guide yet there’s no formal definition for it. What kind of object is it?