IBM Content Manager, Version 8.5      Supports:  Oracle, DB2, C++, Java

Using escape sequences in your queries

Proper handling of special characters ensures successful execution of queries and obtains the query results you want.

To support advanced features of the query language (like the wildcards % or _ inside of text strings), escape sequences are used to differentiate between the cases when wildcards are treated as regular characters versus when they are given the special meaning of wildcard characters. For the user, it is important to know which characters are used as wildcards because wildcard characters, when intended to be treated as regular characters, must be preceded by an escape character. Escape sequences are also used to handle single and double quotes.

You need to add escape sequences when the strings used in queries contain either special characters (double-quote, apostrophe) or wildcard characters (percent sign, underscore, star, question mark) or a default escape character (a backlash). This handling is the simplest for strings used in comparison conditions and becomes a bit more involved for the LIKE operator and text search functions.

Important: Use wildcard characters sparingly as by using them in your queries can increase the size of your result list significantly, which can decrease performance and return unexpected search results.


Feedback

Last updated: December 2013
dcmaq005.htm

© Copyright IBM Corporation 2013.