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 -> Re: Help - PL/SQL and the LIKE clause

Re: Help - PL/SQL and the LIKE clause

From: Gocha Mchedlishvili <gocham_at_mci2000.com>
Date: Fri, 20 Nov 1998 12:18:02 GMT
Message-ID: <_5d52.5711$8G5.1927@news.cwix.com>


Try to use OPTIMIZER_MODE = RULE in initORCL.ora

Gocha

ronb8168_at_my-dejanews.com wrote in message <731ui4$v3r$1_at_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 Fri Nov 20 1998 - 06:18:02 CST

Original text of this message

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