Multi-use cursor in a package.

From: Mark Woodbury <mark.woodbury_at_ps.net>
Date: 1998/01/20
Message-ID: <34c4c54c.7571381_at_NEWS.PS.NET>#1/1


[Quoted] I have a not uncommon situation I am trying to program using a package.

One of the procedures in the package joins two tables which will return a number of columns from both tables. If the second table has no records to satisfy the query (this is ok), this is detected and the first table is queried, placing zeros in the columns of the second table.

Is it possible:
1.Use a "weak reference" cursor in a package which is defined in the specification, and used as a return variable by the procedure.

2. In the procedure , open the cursor using OPEN name FOR SELECT query... for both queryies. The cursor layouts are the same.

3. Return the cursor to the caller.

I can get the package to compile and store in the database, but I haven't had any luck getting it to execute. Page 171 of the O'Reilly Oracle PL/SQL Programming book says you have to have a RETURN on a cursor defined in a package specification, which I don't have.

Anyone have any ideas?

Thanks,
Mark Received on Tue Jan 20 1998 - 00:00:00 CET

Original text of this message