title: PLSQL scenario with variable consisting column names
body: <p>I am new to PLSQL and I would like to display in dbms.output unknown number of columns(list of column names is in defined variable). In example it is two columns and there are two different rows expected as result. I have created below code, which I thought might work, but I suppose it is far from being correct.</p>
  
  <pre><code>DECLARE
  v_TEMP_QUERY        VARCHAR2 (1000 BYTE);
  v_TEMP_VALUE        VARCHAR2 (1000 BYTE) := 'FILTER_01, FILTER_02';
  
  BEGIN   
  FOR v_TEMP_LOOP IN 
  (v_TEMP_QUERY := 'SELECT DISTINCT ' || v_TEMP_VALUE || ' FROM CW_PAGE_COMPONENT_TEMPL WHERE COMPONENT_TEMPL_ID = 10000034642';
  EXECUTE IMMEDIATE v_TEMP_QUERY;)
  LOOP 
  DBMS_OUTPUT.PUT_LINE (v_TEMP_LOOP.v_TEMP_VALUE);
  END LOOP;
  END;
  </code></pre>
  
  <p>Thanks in advance for Your help and advice,</p>
  
  <p>Sebastian</p>