title: ORA-00984: column not allowed here dynamic sql
body: <p>I'm trying to run this sql script in oracle and get an error </p>
  
  <blockquote>
    <p>ORA-00984: column not allowed here.</p>
  </blockquote>
  
  <pre><code>declare
    tablename varchar2(200):='imagesroom';
    temp varchar2(50):='room_id';
    iid number:=1;
    dir varchar2(200):='imgdirroom';
    in_fname varchar2(100):='img1.jpg';
    obj ORDIMAGE;
    ctx RAW(64) := NULL;
  begin
    execute immediate 'INSERT INTO '||tablename||'('||temp||',extension,icon) 
    VALUES(iid,'''',ORDImage(''FILE'',upper(dir),in_fname)) 
    RETURNING icon INTO obj';
  end;
  /   
  
  ERROR at line 1:
  ORA-00984: column not allowed here
  ORA-06512: at line 10
  </code></pre>
  
  <p>This one works great</p>
  
  <pre><code>INSERT INTO imagesroom(room_id,extension,icon) 
  VALUES(iid,'',ORDImage('FILE',upper(dir),in_fname)) 
  RETURNING icon INTO obj;
  </code></pre>
  
  <p>What's wrong with it?</p>
  
  <p>if I do it this way</p>
  
  <pre><code>execute immediate 'INSERT INTO :table(:type,extension,icon) 
  VALUES(:id,'''',ORDImage(''FILE'',upper(:dir),:fname)) RETURNING icon INTO obj' 
  using tablename,temp,iid,dir,in_fname;
  </code></pre>
  
  <p>then</p>
  
  <pre><code>ERROR at line 1:
  ORA-00903: invalid table name
  ORA-06512: at line 10
  </code></pre>
  
  <p>appear...</p>