title: How do I use dynamic SQL to declare a column name derived from a table name?
body: <p>Building on <a href="https://stackoverflow.com/questions/3439278/in-a-pl-sql-procedure-how-do-i-pass-a-table-name-as-a-parameter/3439288#3439288">Tony's answer</a> on <a href="https://stackoverflow.com/questions/3439278">this question</a>:</p>
  
  <p>If I want to do something like this,</p>
  
  <pre><code>CREATE PROCEDURE A(tab IN VARCHAR2) IS
  tab.col_name &lt;column&gt; --static declaration (column name always remains the same)
  BEGIN
     EXECUTE IMMEDIATE 'INSERT INTO ' || tab(col_name) || 'VALUES(123)';
  END A;
  </code></pre>
  
  <p><strong>How can I use Dynamic SQL in the above case?</strong></p>