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 -> Return rows from a package

Return rows from a package

From: Andy Rigby <andy_at_softap.co.uk>
Date: 22 Feb 2002 10:49:44 -0800
Message-ID: <56c32d01.0202221049.6a3cea76@posting.google.com>


Hi

I'm trying to write a package procedure that will return a certain number of rows from a cursor, back to ADO. I am using the Oracle OLE DB provider, with Visual C++ at the front end.

I have managed to create a procedure that returns all the rows in the cursor by declaring it as a REF CURSOR in the usual way in the package header.

What I cannot quite get straight in my head is how to return just some rows. I can of course set up a LOOP on the opened cursor, but then how do I return the rows that I fetch? I looked into creating a temp table but that seems a slow method to me, also I can't see how to insert FETCHed rows from my cursor into the temp table.

I don't want to use ROWNUM<n on the cursor statement because there are performance problems with that approach with the complex SELECTs that I am using for my cursors (which is why I am trying to code it myself in a procedure).

Alternatively, I wouldn't mind doing it via an Oracle table (ie array) - the only problem with that approach is that the routine is supposed to be general purpose so the structure of the cursor will be undefined.

All advice much appreciated,

Andy Rigby Received on Fri Feb 22 2002 - 12:49:44 CST

Original text of this message

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