title: Dynamic SQL within cursor
body: <p>My dynamic sql below to alter a table &amp; create columns based on the output of a query is giving error.</p>
  
  <p>Query :</p>
  
  <pre><code>DECLARE
     CURSOR c1 is select distinct WP_NO from temp;
     cnum VARCHAR2(255);
  
  BEGIN
  
    FOR cnum in c1 
    LOOP
      EXECUTE IMMEDIATE 'Alter table temp_col add (:1 varchar2(255))' using cnum;
    END LOOP;  
  
    COMMIT;
  
  END;
  </code></pre>
  
  <p>Error :</p>
  
  <blockquote>
    <p>PLS-00457: expressions have to be of SQL types</p>
  </blockquote>