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 -> Limiting Bulk Collect

Limiting Bulk Collect

From: Martin Haltmayer <Martin.Haltmayer_at_0800-einwahl.de>
Date: Fri, 14 Jan 2000 00:18:04 +0200
Message-ID: <387E4F1C.6C9AF9D2@0800-einwahl.de>


We run Oracle 8i EE on Sun Solaris 2.6 and on NT 4.0 SP5.

Bulk collect into works fine but I don't know how to limit the number of rows to retrieve in one go. I do roughly

type t1 is table of integer index by binary_integer; b1 t1;
type t2 is table of number index by binary_integer; b2 t2;
type t3 is table of date index by binary_integer; b3 t3;
...

open c;
fetch c bulk collect into b1, b2, b3;
close c;

where b1, b2, b3 are tables of xxxx index by binary_integer. If I pass this to ADO in an ASP page I get ORA-06513 when I return more than was expected.

I can limit the amount of fetched rows by using VARRAY (nnn) of xxx, but I cannot code nnn fixed as it is only known at runtime. For this I did

type t1 is varray (999) of integer;
b1 t1;
type t2 is varray (999) of number;
b2 t2;
type t3 is varray (999) of date;
b3 t3;
end_of_bulk exception;
pragma exception_init (end_of_bulk, - 22160);
...

open c;
begin

   fetch c bulk collect into b1, b2, b3; exception

   when end_of_bulk then
   null;
   when others then
   raise;
end;
close c;

Can you perhaps help me? Any hints appreciated.

Martin Received on Thu Jan 13 2000 - 16:18:04 CST

Original text of this message

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