function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

SOQL error in Winter '10

I'm getting a new error in Winter '10.


"Implementation restriction: expression binding is not
allowed in the SELECT list of a batch query"


I started getting this error when we moved to a Winter '10 sandbox. The SOQL in question looks something like this:


select from referral__c r where...


Note the "r" alias for referral__c.


This query is used to instantiate a StandardSetController. Other queries (not associated with a StandardSetController) with the alias notation work fine.


Removing the alias solves the problem.






Hi, there is a bug W-632571 that appears to cover this issue, however we did not realize it was a regression and so it was not prioritized as such. I will follow up and update the post with the bug status.

Just discovered our exception handling in this area is non-deterministic. Can you give us a repro case so that we can narrow it down. Our apologies for the run around. Greg

Message Edited by gjs on 09-21-2009 04:02 PM

I am also seeing this error being raised by a custom controller that is deployed by a package that I have created. I get the error in a configuration-only sandbox, but not in the production org that has the exact same package installed. While the error doesn't give me an exact line number, I suspect it is failing when try to instantiate a StandardSetController with a record set generated by the Database.getQueryLocator call with a query that looks something like:


SELECT t.Id, t.Name, t.Whatever FROM CustomType t WHERE t.Whatever = something


This is not a Winter '10 sandbox. It is a config-only sandbox that was created on 8/31/09. I just noticed this error today. Not sure if it was happening earlier.

Oh, sorry, I just realized that it is a Winter '10 sandbox.

I was able to work around this issue by removing the alias from my SOQL query. I didn't need it anyway, since my query was unambiguous.