IBM Books

Call Level Interface Guide and Reference

LIKE Predicate Escape Clauses

In a SQL LIKE predicate, the metacharacter % matches zero or more of any character and the metacharacter _ matches any one character. The ESCAPE clause allows the definition of patterns intended to match values that contain the actual percent and underscore characters by preceding them with an escape character. The escape clause ODBC uses to define the LIKE predicate escape character is:

{escape 'escape-character'}
where escape-character is any character supported by the DB2 rules governing the use of the ESCAPE clause.

Applications that are not concerned about portability across different vendor DBMS products should pass the ESCAPE clause directly to the data source. To determine when LIKE predicate escape characters are supported by a particular DB2 data source, an application should call SQLGetInfo() with the SQL_LIKE_ESCAPE_CLAUSE information type.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]