Mapping the LIKE operator: LikeOpMapper element
The LikeOpMapper element is used for customizing the mapping of the LIKE operator. The default template is $P0 LIKE $P1 ESCAPE '@'. $P1 is the pattern against which to compare the string $P0. $P0 and $P1 are both of type VARCHAR.
To map the LIKE operator, do the following:
*Determine whether the database has an equivalent for the LIKE operator. The database equivalent must be able to support escaping special characters in the pattern, for example through the ESCAPE clause. If no database equivalent exists, disable the mapping by setting the Disabled attribute to true.
*Identify the character that the database uses for matching a single character. For example, standard SQL uses the underscore (_). Set the SingleMatchChar attribute to this character. If no such character exists, disable the mapping by setting the Disabled attribute to true.
*Identify the character that the database uses for matching any number of characters. For example, standard SQL uses the percent sign (%). Set the GreedyMatchChar attribute to this character. If no such character exists, disable the mapping by setting the Disabled attribute to true.
*Determine how special characters are escaped on the database. Typically, you specify an escape character, for example, backslash (\), using an ESCAPE clause in the LIKE template, for example, $P0 LIKE $P1 ESCAPE '\'. You then specify the EscapeTemplate attribute to show how to escape special characters. For example, \$ indicates that the backslash precedes the special character.
*Identify any additional special characters that the database recognizes within the pattern. For example, some databases allow pattern matching using the square bracket syntax [a‑z0‑9]. In this case, the square brackets must be escaped whenever the Integration service pushes queries to the database to ensure that the database interprets these characters as literals.
The attributes used for customizing the LIKE operator mapping are listed in Table 10‑9.
Table 10‑9 Attributes for customizing the LIKE operator mapping 
Attribute name
Description
Required?
Disabled
Set to True to disable the mapping for the LIKE operator.
No. Default is False.
SingleMatchChar
Character used on the database to match a single character.
No. Default is underscore (_). For example, on the database '_rown' matches 'Brown' and 'Crown'.
GreedyMatchChar
Character used on the database to match any number of characters.
No. Default is percent sign (%). For example, on the database 'Hat%' matches 'Hatcher' and 'Hathaway'.
EscapeTemplate
Template that shows how to escape a special character on the database. In the template, $ stands for the special character, while $$ stands for the dollar sign.
No. Default is @$. By default, the characters used on the database for single match and greedy match are escaped by prepending an @.
AdditionalSpecialChars
Any special characters other than the single match character and the greedy match character. Additional special characters are listed without spaces.
No. Default is at sign (@), the default escape character.
Example: Mapping the LIKE operator
Your database has an equivalent for the LIKE operator called MATCH. The MATCH operator uses the question mark (?) to match a single character and the asterisk (*) to match any number of characters. The MATCH operator uses square brackets to escape special characters, for example, [?]:
<LikeOpMapper SingleMatchChar="?"
GreedyMatchChar="*"
EscapeTemplate="[$]"
AdditionalSpecialChars="[]">
<FunctionMappings>
<FunctionMapping FunctionName="LIKE">
MATCH ($P0, $P1)
</FunctionMapping>
</FunctionMappings>
</LikeOpMapper>
Example: Changing the escape character
Your database supports the LIKE operator but errors occur when you use the at sign (@) as the escape character, so you use the backslash (\) instead:
<LikeOpMapper
EscapeTemplate="\$"
AdditionalSpecialChars="\">
<FunctionMappings>
<FunctionMapping FunctionName="LIKE">
$P0 LIKE $P1 ESCAPE '\'
</FunctionMapping>
</FunctionMappings>
</LikeOpMapper>
Example: Disabling the LIKE operator
Your database has no equivalent for the LIKE operator so you disable the mapping. Disabling the mapping means that the Integration service processes LIKE expressions, not the database:
<LikeOpMapper Disabled="true" />
Example: Specifying additional special characters
Your database supports the LIKE operator, but extends it to recognize patterns such as [a-z0-9]. If the characters open square bracket ([), close square bracket (]), and hyphen (-) appear in a string, they must be escaped so that the database interprets them as literals instead of assigning special meaning to them:
<LikeOpMapper AdditionalSpecialChars="@[]-" />