Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> cursor fetching
Hi,
I have a procedure that returns a REF CURSOR (defined as TYPES.ref_cursor).
After getting the cursor I would like to iterate over it, which I can do
with the FETCH statement. Is there a way not to have to define as much
variables for the FETCH as the number of columns in the cursor? Here's what
I mean:
procedure x(c out types.ref_cursor);
...
declare
c types.ref_cursor;
x1 ...; -- var. declarations with the appropriate types x2 ...; x3 ...; x4 ...;
x(c);
loop
fetch c into x1,x2,x3,x4; do_something_with(x4); -- I need only x4end loop;
So only need x4, and I wouldn't like to have to also define x1, x2, x3 in vain.
Thx,
Gus
Received on Wed Jul 28 2004 - 04:11:26 CDT