You need to sign in to do that
Don't have an account?
hisrinu
While executing the above dynamic SOQL query, I am getting the following error. System.QueryException: unexpected token: .
If my Account query is returning <= 10 then its working fine, but if it returns more than 10 then I am getting the error.
Any suggestions on this are highly appreciated.
Note: I need to execute this as Dynamic SOQL not the static SOQL.
Message Edited by hisrinu on 12-29-2008 04:29 AM
Problem in Dynamic SOQL
Code:
public class List1
{
Public void abc()
{
List<Account> acc = new List<Account>();
List<String> IdList = new List<String>();
List<Contact> ConList = new List<Contact>;
acc = [select Id from Account];
for(Account a : Acc)
{
String temp = '\''+a.Id+'\'';
IdList.add(temp);
}
String s = 'select id from Contact where Account.id in '+IdList;
ConList = Database.query(s);
}
}
While executing the above dynamic SOQL query, I am getting the following error. System.QueryException: unexpected token: .
If my Account query is returning <= 10 then its working fine, but if it returns more than 10 then I am getting the error.
Any suggestions on this are highly appreciated.
Note: I need to execute this as Dynamic SOQL not the static SOQL.
Message Edited by hisrinu on 12-29-2008 04:29 AM
You could call that function like this:
I hope this helps.
Wilmer
All Answers
You could call that function like this:
I hope this helps.
Wilmer
Thanks for your reply, its working fine.
Thanks a lot.
one more question do you have any idea on the max length of string data type.
I hope it is 32000 characters?