Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Help - PL/SQL and the LIKE clause
Hi,
If you code a select statement in PL/SQL where the LIKE clause uses a variable instead of a literal (example WHERE COL1 LIKE VAR_NAME vs. WHERE COL1 LIKE 'VALUE%'), even though the value in the variable does not have a % in the front of the value, the optimizer does a full table scan instead of an index scan.
Does anyone know a trick to tell the optimized to do an index scan short of using an INDEX hint?
Thanks
Ron B
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Nov 19 1998 - 14:20:41 CST