+ Start a Discussion

System.LimitException: Too many query rows: 725 stacktrace???? HELPPPPP


   What is this error:

System.LimitException: Too
many query rows: 725 stacktrace

What is wrong with my method here... this is where I am getting the error.



public List<Opportunity> getOpportunities(){
        opportunities = [Select o.name, o.CloseDate, 
            (Select x_CC__c From cv__R00N40000001X8re__r) 
        FROM Opportunity o 
        WHERE x_Date__c = NULL 
        AND StageName = 'Received' ORDER BY CloseDate];

      return opportunities;




Is this in a trigger, or outside a trigger?  Also, I highly recommend not using = null in a WHERE clause.  It won't scale, and the performance degrades significantly as the size of your opps object grows (the platform can't optimize on queries like that, so it uses more resources).


Thanks it is a apex class trigger by a button or VF page...

But if I do not use NULL

what would be another version of NULL is it better to use x_Date__c="" or LEN(x_Date__c)=0 ????


i can't make a recommendation there, but I can say that writing queries based on null isn't recommended.  if you absolutely have to, you do, but just warning you.