Questions tagged [querylocator]

Represents the record set returned by Database.getQueryLocator and used with Batch Apex.

Filter by
Sorted by
Tagged with
10
votes
2answers
9k views

Exception: QUERY_TIMEOUT Your query request was running for too long

Querying on approx 25 million contacts using the following query in database.getQueryLocator. Used Query Resource Feedback (Link) to get some feedback about query and here are the results. Query - 1: ...
5
votes
2answers
624 views

What kind of actions open a query locator

We use a batched approach for read and update CampaignMember records within an external application (Webservice Connector, or WSC SOAP API). The approach can be described like this: Query campaign ...
1
vote
2answers
753 views

How to Delete Records in a object except Newly created 1000 Records by using Batch Class?

I have a question, how to delete all records except newly created 1000 records(For Eg: in a Account Object i have 11000 records,in that 1000 records are created in this month, now all 10000 records ...
0
votes
2answers
496 views

Query exception - Unexpected token '{'

I have below query string in an apex batch class that throw error. Can some one please help? Error Unexpected token '{' Query String String query = 'SELECT Call_Duration_Required_abv__c,Id FROM ...