title: How to return multiple rows from oracle stored procedure from multiple cursors?
body: <p>I need to have stored procedure where I can run multiple cursors. </p>
  
  <p>Loop over each cursor and then do some operation on each row. </p>
  
  <p>This way I will have the desired result from these cursors. Result of such multiple cursors then needs to be union with some other rows and then filtered  out and return those rows finally from the proc.</p>
  
  <p>Please note that each cusror and another queries will have same columns.  </p>
  
  <p>I am not sure how to do this in the oracle. </p>
  
  <p>Please help me out. </p>
  
  <pre><code>        create or replace PROCEDURE test_proc
      (
        -- some inputs 
        hc_cursor OUT SYS_REFCURSOR
      ) 
  
      IS 
  
      cursor cursor_one is 
          SELECT * FROM table_one ; 
  
      BEGIN    
  
       FOR current_row in cursor_one
        loop 
  
            -- do some modification on each row and return each modified row
  
        end loop; 
  
      cursor cursor_two is 
          SELECT * FROM table_one ; 
  
      BEGIN    
  
       FOR current_row in cursor_two
        loop 
  
            -- do some modification on each row and return each modified row
            -- append to result from first cursor 
  
        end loop; 
  
  
      -- union results from both these cusrors with some another query 
      -- now filter these records on some criterais 
      -- return finally
  
      END;    
  </code></pre>