Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Help - PL/SQL and the LIKE clause

Help - PL/SQL and the LIKE clause

From: <ronb8168_at_my-dejanews.com>
Date: Thu, 19 Nov 1998 20:20:41 GMT
Message-ID: <731ui4$v3r$1@nnrp1.dejanews.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US