• #19725
    Salesforce | Manpreet Manpreet #232
    Forcetalks

    What are Cursors in Salesforce?

    What exactly do we mean if we say “A user can have up to 50 query cursors open at a time”.

     

    #19742
    Salesforce | Saurabh Saurabh #132
    Forcetalks

    Hi Manpreet

    a cursor is a reference to the the result set for a soql query.

    Select Id, name, (select Id, name from contacts) from account

    Will account for 2 open cursors.

    The way out was to simplify the soql queries and break what we were trying to achieve in one batch apex class over 2 classes.

    Hope it may help

    #41103
    Forcetalks

    Cursors as I understand are the equivalent of query result sets . A similar concept exists in SQL if you’re familiar with it.

    So I’d say a cursor is a reference to the the result set for a soql query.

    I had a support case with salesforce a while ago about cursors exceeded in a batch apex query.apparently even inner queries will account for their own cursor set

    So
    Select Id, name, (select Id, name from contacts) from account

    Will account for 2 open cursors.

    The way out was to simplify the soql queries and break what we were trying to achieve in one batch apex class over 2 classes.

Viewing 3 posts - 1 through 3 (of 3 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?