You need to sign in to do that
Don't have an account?
Mamatha Master
single quote problem in query
Hi
While using API QueryResult and query function i got an exception
+ System.SystemException {"MALFORMED_QUERY: \nId from Account where Name='cv's interest'\n ^\nERROR at Row:1:Column:44\nunexpected token: s interest"} System.SystemException
It's because of single quote(') in the query.
Here is my code:
sforce.QueryResult acc=sfc.query ("select Id,Name from Account where Name='cv's interest'");
Here account name=cv's interest having single quote in it.
It is causing that error.
Can anyone help me to over come this problem (single quote) while using query function of API
Thanks for your help
------MM
Superfell
You have to escape the single quote, e.g. where name='foo\'s shop'
xiaolulu
do you know how can I using replace replace single quote(') to \'
str.replace("'","\'") does not work.
thanks