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 -> cursor fetching

cursor fetching

From: Agoston Bejo <gusz1_at_freemail.hu>
Date: Wed, 28 Jul 2004 11:11:26 +0200
Message-ID: <ce7qot$vlv$1@news.caesar.elte.hu>


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 Received on Wed Jul 28 2004 - 04:11:26 CDT

Original text of this message

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