Wildcard in SELECT statement defined as a variable
618236Sep 14 2009 — edited Sep 14 2009Hi,
The following query works in a PL/SQL procedure (it's defined in a variable because the WHERE clause will eventually be built at run time):
l_select_statement VARCHAR2(4000) :=
'SELECT XMLELEMENT (
..........
FROM WEB_VPREPARATIONS W WHERE CODE LIKE :code';
I execute it via a cursor, like this:
OPEN l_prod_cv FOR l_select_statement USING in_code;
I would like to add the '%' wildcard on either side of ':code', but nothing that I've tried works (e.g., LIKE ''%:code%'' using two single quotes on either side). Any help would be greatly appreciated. Thanks,
Chris.