I basically want to run a SOQL query that is looking at a list of String values in the WHERE condition, like this:
// An IN-bind with an Id list. Note that a list of sObjects // can also be used--the Ids of the objects are used for // the bind Contact[] cc = [SELECT Id FROM Contact LIMIT 2]; Task[] tt = [SELECT Id FROM Task WHERE WhoId IN :cc]; // An IN-bind with a String list String[] ss = new String[]{'a', 'b'}; Account[] aa = [SELECT Id FROM Account WHERE AccountNumber IN :ss];
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_variables.htm
No comments:
Post a Comment