STRING ESCAPE CHARACTERS:
You can use the following escape sequences with SOQL:
The following characters are reserved:
Example:
To query the Account Name field for “Nagarjuna’s site,” use the following SELECT statement:
In computing and telecommunication, an escape character is a character which invokes an alternative interpretation on subsequent characters in a character sequence. An escape character is a particular case of metacharacters. Generally, the judgement of whether something is an escape character or not depends on context.
Escape Sequences
|
Meaning
|
\n or \N
|
New Line
|
\r or \R
|
Carriage return
|
\t or \T
|
Tab
|
\b or \B
|
Bell
|
\f or \F
|
Form 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 ( % )
|
Example:
Select all Accounts whose name begins with the letter 'N'.
RESERVED CHARACTERS:
A reserved characters are a character or set of characters that cannot be used because of their use in other locations or by the operating system.
Select all Accounts whose name begins with the letter 'N'.
SELECT Id FROM Account WHERE Name LIKE N%'
RESERVED CHARACTERS:
A reserved characters are a character or set of characters that cannot be used because of their use in other locations or by the operating system.
'
|
Single quote
|
\
|
Backslash
|
Example:
To query the Account Name field for “Nagarjuna’s site,” use the following SELECT statement:
SELECT Id FROM Account WHERE Name LIKE 'Nagarjuna\'s site'