Solved

Insert an object of type ref cursor into a table ( Oracle PL/SQL )

Posted on 2008-10-28
3
1,511 Views
Last Modified: 2013-12-18
  PROCEDURE ALPHA (
      BETA       IN       NUMBER,
      GAMMA_LIST   IN OUT   c_list,
      DELTA       OUT      INTEGER
   )
   IS .....


The c_list type is REF CURSOR.

In order to debug, how could I download the c_list content into a table?
0
Comment
Question by:hc2342uhxx3vw36x96hq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 22824618

Try this in sqlplus:

var beta number;
var gamma_list refcursor;
var delta number;
exec :beta:=-1;
exec PROCEDURE ALPHA (:beta,:gamma_list,:delta);
print delta;
print gamma_list;

Open in new window

0
 
LVL 27

Accepted Solution

by:
sujith80 earned 500 total points
ID: 22827887
c_list - is opened for a query.
You may
1. print the query using dbms_output.put_line
2. if you want to see the run time data of the ref cursor; you may create a table for debug purpose corresponding to the query and insert data into the table.
3. of the query changes at run time, you may use dynamic sql to do "create table as" using the query of the ref-cursor.
0
 
LVL 1

Author Closing Comment

by:hc2342uhxx3vw36x96hq
ID: 31510673
Thank you very much for your kind cooperation! ;-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question