Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Get values from REF CURSORS in Stored Procedures
On 2 Jul 2002 01:28:59 -0700, teoman.ayan_at_contakt.net (teoman) wrote:
>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?
simply define the type as REF CURSOR, which implies a weakly typed cursor and can return anything
Hth
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Tue Jul 02 2002 - 14:16:25 CDT
![]() |
![]() |