title: how to generate execution plan for oracle loop
body: <p>How can I generate execution plan for an oracle loop query like below:</p>
  
  <pre><code>BEGIN 
    FOR L IN (SELECT FIRST_NAME, LAST_NAME, SOME_ID FROM TABLE1)
    LOOP
        INSERT INTO TABLE2 (FIRSTNAME, LASTNAME)
        (SELECT FNAME, LASTNAME FROM TABLE2 WHERE SOME_ID = L.SOME_ID)
  
    V_CNT := V_CNT + 1;
  
    IF (MOD(V_CNT, 1000)=0) THEN
      COMMIT;
    END IF;
  
  END LOOP;
  </code></pre>
  
  <p>How can I generate execution plan for a block like above?</p>
  
  <p>I asked similar question <a href="https://stackoverflow.com/questions/4510491/how-to-generate-explain-plan-for-entire-stored-procedure">earlier</a> and decided to extract blocks from my stored procedure and generate execution plans for the individually.  Though I know how to generate plans for simple queries, I dont know how to generate them for loop blocks like above. </p>