title: Assigning one refcursor to another refcursor
body: <p>I have a huge sub query which resolves into the IN clause of my main query like below:</p>
  
  <pre><code>DELETE from my_table where one_column IN (my huge complicated sub query);
  </code></pre>
  
  <p>My sub query is going to return more than one record of only one column of type NUMBER. And is inside a procedure.</p>
  
  <p>For EG:  resultset of my subquery will look like:</p>
  
  <pre><code>----------
  one_column
  ----------
  23
  24
  27
  34
  39
  43
  48
  </code></pre>
  
  <p>And my main query is going to delete the records based on the values returned by the sub query.</p>
  
  <p>My requirement is: I need to return the output of sub query as a ref cursor. 
  What I tried: Executing the query as it is and then after deletion opening a ref cursor and execute the subquery again and returning it. This worked. But I dont want this redundancy.</p>
  
  <pre><code>    DELETE from my_table where one_column IN (my huge complicated sub query);
      Open my_cursor for
        my huge complicated  sub query;
  </code></pre>
  
  <p>(This is my_cursor is out variable in the package)</p>
  
  <p>What I want to do:</p>
  
  <pre><code> DECLARE 
          my_cursor_2 SYS_REFCURSOR;
      BEGIN
          Open my_cursor_2 for
            my huge complicated  sub query;
          my_cursor := my_cursor_2; // something like this - I know this will obviosuly create one more handle for the same resultset and wont serve my purpose. Basically I want to clone the cursor and use it as a different one
          DELETE from my_table where one_column IN (read from my_cursor_2 for input to the delete query);
          And return my_cursor as out var of the procedure
  </code></pre>
  
  <p>Is it possible? OR any other better way to acheive this?</p>