Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Get values from REF CURSORS in Stored Procedures

Get values from REF CURSORS in Stored Procedures

From: teoman <teoman.ayan_at_contakt.net>
Date: 2 Jul 2002 01:28:59 -0700
Message-ID: <a8fa219e.0207020028.2c6095bf@posting.google.com>


I want to know how can I get the values from ref cursors in stored procedures? I give a little example:

create or replace procedure mytest(ReturnCursor in out ref_cursor.mycursor, "PART_NUMBER" in Varchar2) is
p_part_number varchar2(40) := "PART_NUMBER"; sqltext varchar2(2000);
begin
sqltext := 'select * from product where part_number = '''|| p_part_number||''''; open returncursor for sqltext;
end mytest;

If i want use the procedure like this

declare
myc ref_Cursor.mycursor;
cursor cr
is
select * from product;
rec cr%rowtype;
begin
mytest(myc,'PAT-LIC-ADL');
fetch myc into rec;
dbms_output.put_line(rec.DESCRIPTION);
end;

thats ok. But I don't have in all cases the cursor definition. I need "variant" variables or something like that. How can i manage it? Received on Tue Jul 02 2002 - 03:28:59 CDT

Original text of this message

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