Thursday, October 03, 2013

Escape from Single Quote

Everytime I need to do soql statement I have to googling around.I keep forgeting.

Okay, I copy this from salesforce link here.
SequenceMeaning
\n or \NNew line
\r or \RCarriage return
\t or \TTab
\b or \BBell
\f or \FForm feed
\"One double-quote character
\'One single-quote character
\\Backslash
LIKE expression only: \_Matches a single underscore character ( _ )
LIKE expression only:\%Matches a single percent sign character ( % )


This is how I run query using escape for single in Force Explorer.
select Id,Name from Country where Name in('COTE D\'IVOIRE','CURACAO','KAZAKHSTAN',
'LAO PEOPLE\'S DEMOCRATIC REPUBLIC','LIBYAN ARAB JAMAHIRIYA','MACAO')
order by Name
Done.:)

No comments:

Post a Comment