Skip to content

Instantly share code, notes, and snippets.

@capeterson
Created June 19, 2012 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capeterson/2955412 to your computer and use it in GitHub Desktop.
Save capeterson/2955412 to your computer and use it in GitHub Desktop.
Dynamic SOQL + var binding
Set<String> names = new Set<String>{'Me','Myself','I'};
String query = 'SELECT id, name FROM User WHERE LastName IN :names';
List<sObject> objs = Database.query(query);
System.debug(objs);
@kevinohara80
Copy link

Actually, the platform now complies to Java bytecode. This is a fairly recent change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment