title: how to define types dynamically in plsql
body: <p>I have a procedure like this:</p>
  
  <pre><code>create or replace procedure pname (tn varchar2) is
  -- here i want to declare the variable
  
    col1 tn%COL_ID
  
  begin
  
  end;
  </code></pre>
  
  <p>and I know that every table i am passing as an argument will contain the column named as COL_ID. But i am not able to do this, i am getting an error like this</p>
  
  <blockquote>
    <p>PLS-00487: Invalid reference to variable 'tn'
         PL/SQL: Item ignored
          PLS-00487: Invalid reference to variable 'tn'
          PL/SQL: Item ignored</p>
  </blockquote>
  
  <p>Please help me in how to declare variables like that.</p>