title: pl/sql column name as variable using cursor
body: <p>I've got a table with columns like "day_1" 'day_2' 'day_3' etc 
  I want to run over them using something like that:
  day='day_'||to_char(i);
  rec.day....</p>
  
  <p>i've already learned that there's cool thing called execute emmediate, but it doesn't works for me, here's the code</p>
  
  <pre><code>    set SERVEROUTPUT on
  
  declare
  cursor work_days is select distinct day_1, day_2,day_3........
  from workDays;
  str varchar2(256);
  wday varchar2(10);
  
  begin
  for rec in work_days loop
  for j in 1..2 loop
  str:='SELECT ''day'||to_Char(j)||''' from dual';
  execute immediate str into wday;
  DBMS_OUTPUT.PUT_LINE(rec.wday);
  end loop;
  end loop;
  end;
  </code></pre>
  
  <p>and here's the mistake</p>
  
  <pre><code>PLS-00302: component 'WDAY' must be declared
  </code></pre>