Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Optimizer hints in PL/SQL's embedded SQL
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...Received on Tue Oct 29 2002 - 03:57:45 CST
> 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
>
>
>
![]() |
![]() |