title: Oracle Procedure cursor as a varchar2 variable
body: <p>I want to pass a string like <code>"select 'a' as alphabet, 1 as number from dual"</code> to procedure and use the same to assign to a cursor. </p>
  
  <p>Here is my code how my proc looks like</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE ME( sqlstmt in varchar2 )
  AS  
    C1 CURSOR IS sqlstmt;
  
  BEGIN  
    FOR REC IN C1 
          LOOP
              DBMS_OUTPUT.PUT_LINE(REC.alphabet);
          END LOOP;
  END;
  </code></pre>
  
  <p>Tried execute immediate and other stuff but nothing helped.</p>