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

From: <>
Date: Thu, 14 Nov 2013 05:32:29 -0800 (PST)
Message-ID: <>


I have this procedure:

procedure teste( str_valor     in varchar2 ,
                 split_array  out  SYS_REFCURSOR)

    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;

    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