title: Oracle cursor loop that calls stored procedure
body: <p>how I can create a loop that calls stored procedure?
  I have table that contains list of products and I want to check it against table using stored procedure.</p>
  
  <p>Example table content:</p>
  
  <ul>
  <li>apple </li>
  <li>orange  </li>
  <li>banana</li>
  </ul>
  
  <p>In this example I want to execute this procedure 3 times using parameters: (apple, orange, banana).</p>
  
  <p>I wasnt able to work it using cursor... </p>
  
  <pre><code>DECLARE
    CURSOR cur_product
    IS
      SELECT product_name FROM test.products;
  BEGIN
    FOR product IN cur_product
    LOOP
      BEGIN
          EXECUTE TEST_PRODUCT( product);
      END;
    END LOOP;
  END;
  </code></pre>
  
  <p>Stored procedure:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE TEST_PRODUCT 
  (
    PRODUCT IN VARCHAR2 
  ) AS 
  BEGIN
    INSERT INTO TABLE test.product_counts
    SELECT COUNT(*) FROM test.products WHERE product_name = &amp;PRODUCT
  
  END TEST_PRODUCT;
  </code></pre>