title: DB2 casting to DECIMAL
body: <p>I'm trying to cast a number to DECIMAL(10,2).
  If I understand well, a number like "1234567890" should be a valid
  DECIMAL(10,2).
  But when I try to cast it, it returns an -413 error:</p>
  
  <p>"OVERFLOW OR UNDERFLOW OCCURRED DURING NUMERIC DATA TYPE CONVERSION"</p>
  
  <p>This is the SQL:</p>
  
  <pre><code>select CAST( 1234567890 AS DECIMAL(10,2)) from SYSIBM.SYSDUMMY1;
  </code></pre>
  
  <p>As I see it, the problem is that it is adding two zero decimal positions,
  so the total length is 12, which is not valid number for a (10,2).</p>
  
  <p>In fact, if I try to CAST it to (12,2) it works (showing "1234567890.00" ).</p>
  
  <p>I wonder if this is an error or if I'm doing something wrong.
  CASTING to (12,2) does not seem to be a valid option, because it will
  accept numbers like "1234567890.12" that should not be valid for a (10,2).</p>
  
  <p>Thanks in advance.</p>