Databases often treat %
and _
as wildcard characters. Pattern-match queries in the SQL repository (such as CONTAINS, STARTS WITH, or ENDS WITH), assume that a query that includes %
or _
is intended as a literal search including those characters and is not intended to include wildcard characters. The query generated therefore uses an escape character in front of the characters %
and _
in pattern-match queries. One exception applies: a pattern-match query can be used to simulate a text search query; in that case wildcards should be passed through.
You can disable this behavior by setting the escapeWildcards
property of the SQL Repository component to false
.
The escape character is \
(backslash) by default. You can set a different escape character through the wildcardEscapeCharacter
property of the SQL repository component.