+ Start a Discussion
Ken_KoellnerKen_Koellner 

SOQL IN clause limit when referencing list or set variable

Is there any limit to the number of entries in a set or list that can be used in an IN clause in SOQL?

 

 

List<Id>myIdList = ....

List<OpportunityLineItem>oliList = [select id, opportunityId, quantity
                                    from OpportunityLineItem
                                    where id in :myIdList];

 

Is there anythg that would prevent myIdList having 100, or 1000, or 5000 entries and still working with the SOQL query?

 

Ritesh AswaneyRitesh Aswaney

I reckon the maximum size of a collection would be the only restriction - 10K ?

sham_1sham_1

Not sure, but I believe it would be limited to max size of SOQL query that is 10,000 characters.

Prajapati.LakhanPrajapati.Lakhan

Hi ken,

 

Did you figure it out? any documentaion around this limitaion?

 


Thanks,

Lakhan

Rival SuheriRival Suheri
Any documentation on this limitation? I want to know the maximum collection of the 'IN' clause in SOQL