Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: cursor fetching
Agoston Bejo wrote:
> 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 ...;
> begin
> x(c);
> loop
> fetch c into x1,x2,x3,x4;
> do_something_with(x4); -- I need only x4
> end loop;
> end;
>
> So only need x4, and I wouldn't like to have to also define x1, x2, x3 in
> vain.
>
> Thx,
> Gus
Look at the examples at:
http://www.psoug.org/reference/ref_cursors.html
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Wed Jul 28 2004 - 23:36:20 CDT
![]() |
![]() |