title: Oracle Return an Array over DBLINK
body: <p>I have a local and remote database connected by database link.</p>
  
  <p>From my local database, I want to make a call as follows:</p>
  
  <pre><code>declare
      l_rec REMOTE_PKG.array_type@REMOTE_LINK;
  begin
      l_rec := REMOTE_PKG.get_id ( 'test1', 'test1_id' );
      ....process l_rec....
  
      l_rec := REMOTE_PKG.get_id ( 'tab1',  'tab1_id' );
      ....process l_rec....
  end; 
  </code></pre>
  
  <p>At Remote, the function REMOTE_PKG.get_id should return an ARRAY OF INTEGERS using following logic: ( the name of table and ID column is dynamic ).</p>
  
  <pre><code>  select TEST1_ID from TEST1;
    select TAB1_ID from TAB1;
    etc.
  </code></pre>
  
  <p>The table TEST1 can have upto 1,000,000,000 ( 1 billion ) records. Hence that many IDs will have to be returned in an array to local system.</p>
  
  <p>My question is - is it even possible to do what I am trying ?   The complexities come from</p>
  
  <ul>
  <li>sending a REF CURSOR over database link</li>
  <li>performance of sending back an array filled with 1 billion numbers</li>
  <li>error handling </li>
  </ul>