You need to sign in to do that
Don't have an account?

How to use an Array in the Query
Hello All,
I am writing a Java program that gets information from a database and will upload that information into Salesforce.
I have placed the Ids of the Accounts from the database into an Array and I want to query the Accounts object in Salesforce to get me the Account objects from Salesforce where there is a match found in the Array of Ids.
I have a query that reads something like this:
String[] accIds = new String[x];
binding.query("SELECT Id, Name, databaseId FROM Account WHERE databaseId IN " + accIds);
I am getting stuck with the query as I'm not 100% sure how to do it properly and I cannot find any information on how this should be done.
Any help is highly appreciated.
Thanks in advance!
Warren
You will have to enclose each ID in a single quote and have a paranthesis around them. Check out the syntax for IN here.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_comparisonoperators.htm