title: oracle bulk collect and reading the data
body: <p>I have created below proc to read all the data from one table and populate it in a grid in .net form.</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE EVMPDADM.GETALLBATCHES_ARTICLE_57(p_batchstatus OUT XEVMPD_SUBMITTEDBATCH%ROWTYPE )
  IS
  
   TYPE batch_status IS TABLE OF XEVMPD_SUBMITTEDBATCH%ROWTYPE  INDEX BY PLS_INTEGER;
   l_batchstatus batch_status;
  
  BEGIN
  
  SELECT *  BULK COLLECT INTO l_batchstatus FROM XEVMPD_SUBMITTEDBATCH ;
  
     FOR i IN 1..l_batchstatus.count LOOP 
  
      p_batchstatus:= l_batchstatus(i);
  
     END LOOP;
  
  END GETALLBATCHES_ARTICLE_57;
  </code></pre>
  
  <p>To test if the proc is running fine I tried to print the data by using below Pl-sql block:</p>
  
  <pre><code>DECLARE
      v_batchstatus XEVMPD_SUBMITTEDBATCH%ROWTYPE;
      BEGIN
  
      EVMPDADM.GETALLBATCHES_ARTICLE_57(v_batchstatus);
      DBMS_OUTPUT.PUT_LINE( v_batchstatus.Batch_id || ' ' || v_batchstatus.BATCH_DESCRIPTION || ' ' || v_batchstatus.STATUS || ' ' ||v_batchstatus.RECORD_STATUS || ' ' ||v_batchstatus.NUMBER_OF_RECORDS);
  
     END;
   /
  </code></pre>
  
  <p>But from this process I am getting the last row only. 
  I want to print all the records present in the table.
  can any one please help me to figure out what is wrong in the above code.</p>