Could I use as a subquery a cursor returned by a procedure?

From: <biroska_at_gmail.com>
Date: Thu, 14 Nov 2013 05:32:29 -0800 (PST)
Message-ID: <27f200f4-a66b-41e4-b18f-cc1c0b5ece73_at_googlegroups.com>



Hi,

I have this procedure:

procedure teste( str_valor     in varchar2 ,
                 split_array  out  SYS_REFCURSOR)
is
begin

    open split_array for

        select distinct regexp_substr(str_valor,'[^,]+', 1, level) as valor from dual
               connect by regexp_substr(str_valor, '[^,]+', 1, level) is not null;
END teste;

And i would like use the split_array variable as a subquery, something like this:

set serveroutput on;
declare

    str_valor       varchar2(200) := '10,11,12,13';
    valor       varchar2(200);

    t_cursor sys_refcursor;
    qtd_reg number;
BEGIN     dbms_output.put_line('----- '||str_valor||' -------');     teste(str_valor, t_cursor);

    select count(1) into qtd_reg from table_aux p where p.code in (t_cursor);     

    CLOSE t_cursor;     

END; Is it possible? I already tried assossiative array and no sucess too.

Thank you... Received on Thu Nov 14 2013 - 14:32:29 CET

Original text of this message