title: Pl/SQL Procedure CURSOR For Loop
body: <p>I am new to PL/SQL and experimenting with CURSOR.  I desire to verify an insertion procedure so I wrote another procedure to do so.</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE verify_insert
  
  IS
  
     CURSOR map_cur IS
  
        SELECT Page_ID_NBR, Page_Type, Page_Dcpn FROM SSC_Page_Map;
  
        map_rec map_cur%ROWTYPE;
  
  BEGIN
  
     OPEN map_cur;
  
     FOR map_rec in map_cur
  
     LOOP
  
        DBMS_OUTPUT.PUT_LINE('ID: ' || map_cur.Page_ID_NBR || ' ' || 'Type' ||  map_cur.Page_Type || ' ' || 'Description' || map_cur.Page_Dcpn);   
  
     END LOOP;
  
     CLOSE map_cur;
  
  END;
  
  SHOW ERRORS PROCEDURE verify_insert;
  </code></pre>
  
  <p>I am getting the following message</p>
  
  <pre><code>[Warning] ORA-24344: success with compilation error
  19/44   PLS-00225: subprogram or cursor 'MAP_CUR' reference is out of scope
  19/5    PL/SQL: Statement ignored
  (47: 0): Warning: compiled but with compilation errors
  </code></pre>
  
  <p>I also see</p>
  
  <pre><code>Errors for PROCEDURE VERIFY_INSERT
  
  LINE/COL ERROR                                                            
  -------- -----------------------------------------------------------------
  19/44    PLS-00225: subprogram or cursor 'MAP_CUR' reference is out of sco
  
  
  19/5     PL/SQL: Statement ignored                                        
  </code></pre>
  
  <p>As I wrote, I am new and trying to cobble together knowledge of PL/SQL from <code>Oracle PL/SQL Programming (Feuerstein)</code> and the net.  Coming together but not as fast as I want.</p>