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: ADO & PL/SQL: Return cursor from procedure (performance question)

Re: ADO & PL/SQL: Return cursor from procedure (performance question)

From: Noons <wizofoz2k_at_yahoo.com.au>
Date: Tue, 23 Sep 2003 23:52:48 +1000
Message-ID: <3f70502c$0$13416$afc38c87@news.optusnet.com.au>


"Eric Fortin" <emfortin_at_comcast.net> wrote in message news:vuXbb.134595$mp.66950_at_rwcrnsc51.ops.asp.att.net...

> Pseudo...
> ...
> create package...
>
> type retcursor is ref cursor;
> ...
>
> procedure GetEmps(p_ID in number, p_cursor out retcursor)
> ...
> open p_cursor for select * from emp where empno = p_ID;
> ...
> end...
>
> Will this perform as well as using bind variables?

If you write it this way, yes:

open p_cursor for
'select * from emp where empno = :zot'
using p_ID;

The alternative is of course to use the new parameters since 8i to force "bind variable" processing in non-bind variable dynamic SQL.

http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76961/ch126.htm#72489 (watch 4 URL wrapping)

But you gotta make sure the "dynamic" is not *too* dynamic...

-- 
Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam
Received on Tue Sep 23 2003 - 08:52:48 CDT

Original text of this message

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