Solved

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

Posted on 2008-10-28
3
1,502 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now