title: how to return a oracle table in a procedure
body: <p>I have a procedure which calls a function. This function returns a table and now in the procedure I want to select the entire table. I am doing this atm and I get uninitialised collection. </p>
  
  <pre><code> procedure check_all (
        p_period IN RPT_EXT.PERIOD%type default rptsum_time - 1/24/12,
        p_days IN NUMBER default 1/24/12,
        p_data_ext IN VARCHAR2 default DATA_EXT_DE2,
        p_ext_no IN TWS_DIMENSION_DEFINES.EXT_NO%type default null,
        p_record_id IN RPT_EXT.RECORD_ID%type default null
    )
    as
    sql_statement varchar2(200);
    tab extraction_count_tab;
    begin
    tab := extraction_counts( p_period , p_days, p_data_ext, p_ext_no, p_record_id);
     sql_statement := 'select* from tab';
     execute immediate sql_statement; -- need to chacnge this
     dbms_output.put_line(chr(10));
     performance_check(p_period, p_days, p_data_ext);
    end check_all;
  </code></pre>