title: How to execute results of dbms_output.put_line
body: <p>There is a table contains this kind of data: <code>select to_char(sysdate,'day') from dual</code> in a column. I want to get results of the every query that the table keeps.</p>
  
  <p>My result set should be the result of <code>select to_char(sysdate,'day') from dual</code> query. So in this case it is a <strong>tuesday</strong>.  </p>
  
  <p>SO_SQL_BODY is Varchar2.</p>
  
  <p>I wrote this code but it returns only table data. </p>
  
  <pre><code>CREATE  or replace PROCEDURE a_proc
  AS
  
   CURSOR var_cur IS
  
  select  SO_SQL_BODY FROM SO_SUB_VARS group by SO_SQL_BODY;
  
  var_t  var_cur%ROWTYPE;
  
     TYPE var_ntt IS TABLE OF var_t%TYPE;
  
  var_names  var_ntt;
  BEGIN
  OPEN  var_cur;
  FETCH var_cur BULK COLLECT INTO var_names;
  CLOSE var_cur;
  
  FOR indx IN 1..var_names.COUNT LOOP
  
     DBMS_OUTPUT.PUT_LINE(var_names(indx).SO_SQL_BODY);
  
  END LOOP;
  END a_proc;
  </code></pre>