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

FETCH BULK COLLECT from REF CURSOR

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Wed, 17 Apr 2002 16:33:32 +0400
Message-ID: <a9jpvp$so5$1@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 Wed Apr 17 2002 - 07:33:32 CDT

Original text of this message

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