title: IBM DB2 store the query results in a variable
body: <p>I am trying to write a function and I need to store some table in a variable. I don't have the type 'Table'
  I tried to write something like this:</p>
  <pre><code>declare t table(a integer, b integer);
  set t = (select A, B from MyTable);
  </code></pre>
  <p>It does not work.It says there is a syntax error and that there is no table type. What is the solution?
  Is there any other way to store the query results in a variable?</p>