title: Define Variable type dynamically in stored procedures in DB2
body: <p>Is it possible to define the type of a variable in a stored procedure dynamically with the type of a column in a table..</p>
  
  <p>I want to set the type of <code>myVar</code> the type of mytable.mycolumn</p>
  
  <pre><code>DECLARE at_end SMALLINT DEFAULT 0;
  DECLARE myVar VARCHAR(21); -- It should be the type of mytable.mycolumn
  </code></pre>
  
  <p>In Oracle it would be possible with <code>age_of_person mytable.mycolumn%TYPE;</code></p>
  
  <p>How does it work in DB2 9.7??</p>