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: FETCH BULK COLLECT from REF CURSOR

Re: FETCH BULK COLLECT from REF CURSOR

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Tue, 23 Apr 2002 14:52:17 +0400
Message-ID: <aa3eat$50j$1@babylon.agtel.net>


Thanks to all who replied. :)
fetch bulk collect from dynamic ref cursor appears to be only supported in 9i. This is not clearly stated in 8i documentation though. :(

--
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.


"Vladimir M. Zakharychev" <bob_at_dpsp-yes.com> wrote in message news:a9jpvp$so5$1_at_babylon.agtel.net...

> 8.1.7.3.2 on W2k - it don't seem to be able to do a FETCH ... BULK COLLECT INTO ...
> from a weak ref cursor - is it me or is this unsupported? I didn't find any
> restriction on bulk collect from ref cursor in docs - if there is one, please refer
> me to correct location. I only noted that there are no examples of bulk collect
> from ref cursor in the docs, but explicit restriction is nowhere to be found.
>
> Here's my sample code:
>
> declare
> type rc is ref cursor;
> type TArray is table of number [index by binary_integer]; -- no difference if index by is here or
> not
> c rc;
> t TArray;
> begin
> open c for 'select id from sometable where rownum <= 10';
> fetch c bulk collect into t; -- <-- ORA-1001 thrown here at runtime
> close c;
> end;
>
> with the same TArray declaration the following works fine:
>
> select id bulk collect into t from sometable where rownum <= 10;
>
> and the first example works if rewritten to
>
> type TArray is table of number index by binary_integer;
> begin
> open c for '...';
> loop
> fetch c into t(i);
> exit when c%notfound;
> i := i + 1;
> end loop;
> close c;
> end;
>
> Any clues? Surely I can work around this, but it would be nice to make
> this bulk collect work for weak ref cursors...
>
> --
> 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.
>
>
>
Received on Tue Apr 23 2002 - 05:52:17 CDT

Original text of this message

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