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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Optimizer hints in PL/SQL's embedded SQL

Re: Optimizer hints in PL/SQL's embedded SQL

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Tue, 29 Oct 2002 12:57:45 +0300
Message-ID: <aplm7b$fj5$1@babylon.agtel.net>


The way you use hints in PL/SQL is the same as in plain SQL, you just have to make sure you have *at least one space* between plus sign and the hint itself. So if you write your hint like this:

SELECT /*+ INDEX(E) */ .... then it should work in both SQL and PL/SQL (provided the hint itself is valid.)

hth.

-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"Sergey Balter" <balter_at_kompas.donetsk.ua> wrote in message news:aplh8f$16nl$1_at_dipt.donbass.net...

> Hi, All,
>
> When I write something like
>
> procedure test is
> AId Integer;
> begin
> SELECT /*+INDEX(E) */
> E.Id INTO AId
> FROM DocSpec E, .....
> .........
> end;
>
> SQL Engine absolutely ignores hint /*+INDEX(E)*/
> Maybe PL/SQL quesses it's comments :-(((
>
> I am forced to bypass the problem using EXECUTE IMMEDIATE
>
> Is it the unique way? Does anybody know about specifying optimizer
> hint in in PL/SQL's embedded SQL?
>
> Regards,
> Sergey Balter
>
>
>
Received on Tue Oct 29 2002 - 03:57:45 CST

Original text of this message

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