Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Using a Parameter Marker in the SQL Escape Clause of a Like Predicate

IP.com Disclosure Number: IPCOM000104439D
Original Publication Date: 1993-Apr-01
Included in the Prior Art Database: 2005-Mar-19
Document File: 2 page(s) / 36K

Publishing Venue

IBM

Related People

Sappal, N: AUTHOR

Abstract

This article describes an enhancement which will allow the use of a parameter marker as the ESCAPE character in a SQL 'LIKE' predicate. The following is the syntax for the SQL LIKE statement: where the string-constant and host-variable can contain the following special characters:

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 100% of the total text.

Using a Parameter Marker in the SQL Escape Clause of a Like Predicate

      This article describes an enhancement which will allow the use
of a parameter marker as the ESCAPE character in a SQL 'LIKE'
predicate.  The following is the syntax for the SQL LIKE statement:
where the string-constant and host-variable can contain the following
special characters:

1.  % (percent sign) - which is substituted with any sequence of zero
    or more characters.

2.  _ (underscore)   - which is substituted with exactly one
    character.

If an escape character is specified, it is used to indicate that the
character following the escape character in the pattern is NOT to be
treated as a special character.

      OS/2* Database Manager* will allow the user to specify the
escape character using a parameter marker.  The value of the
parameter marker is supplied when the statement is executed.  This is
very useful in an application that is constructing dynamic statements
based on a user's input to an interactive program.

      The data type and length of the parameter marker is assumed to
be a CHAR(1).  If the data type or length of the supplied value is
not compatible with a CHAR(1) value, an error is returned at
execution time.

      The benefits are:

o   Allows the user more options.
o   Provides flexibility when using dynamic SQL.
o   Avoids special casing and arbitrary restrictions.

*  Trademark of IBM Corp.