title: Accessing cursor over db link in Oracle
body: <p>I have to write a stored procedure which invokes a remote procedure via db link. This procedure returns a cursor. When I try to iterate over this cursor I get ORA-01001: invalid cursor Error. I read on some forums that simply it's not allowed to access cursors over db links, but I'm not convinced about that. Anyone know how to solve it? What is important here I can't modify existing remote method. </p>
  
  <p>below is a code of my procedure:</p>
  
  <pre><code>declare
    TYPE generic_cursor IS REF CURSOR;
    refCursorValue generic_cursor;  
   field1 table1.column1@my_db_link%type;
  begin
  
    rempote_package.remote_method@my_db_link('33337136','','',refCursorValue);
  
   loop
        fetch refCursorValue into  field1;      -- here exception is thrown               
        exit when refCursorValue%NOTFOUND;
    end loop;
    close refCursorValue;
  end;
  </code></pre>
  
  <p>interface of remote method is as below:</p>
  
  <pre><code>PROCEDURE remoteMethod (p1 IN VARCHAR2,
   p2 IN VARCHAR2,
   p3 IN VARCHAR2,
   rst_data OUT pkg_resultset.generic_cursor)
  </code></pre>
  
  <p>and pkg_resultset.generic_cursor has got following definition:</p>
  
  <pre><code> TYPE generic_cursor IS REF CURSOR;
  </code></pre>