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 on PL/SQL table

Cursor on PL/SQL table

From: Ian Jennings <ij_at_microware.demon.co.uk>
Date: Mon, 27 Apr 1998 14:53:38 +0100
Message-ID: <35448DE1.D324B439@microware.demon.co.uk>


Hi all,

Can anyone tell me, please, if there's any way to return a cursor on a PL/SQL table?

I have something close to the following:

TYPE a_tbl IS TABLE OF Atbl%ROWTYPE INDEX BY BINARY_INTEGER; TYPE a_cur IS REF CURSOR;

PROCEDURE Foo(a_row IN OUT a_cur) IS

tbl_a a_tbl;
CURSOR c1 IS SELECT * FROM Atbl;
i INTEGER;

BEGIN
    i := 0;
    OPEN c1;
    LOOP

        i := i + 1;
        FETCH c1 INTO tbl_a(i);
        EXIT WHEN c1%NOTFOUND;

    LOOP;
    CLOSE c1;

    Now I need to be able to loop through tbl_a and return the rows in the cursor a_row.

END; No matter what I try, and I've tried plenty, I can't see how to do. There's no examples in any of the books I've got, can't find a sample on the web and there's nothing that I can see in the help.

Any assistance greatly appreciated.

TIA --



Ian Jennings
Microware Data Services

This post is made entirely from recycled ones and noughts


Received on Mon Apr 27 1998 - 08:53:38 CDT

Original text of this message

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