title: DECFLOAT Error While running Procedure in DB2
body: <p>I am executing the following procedure in DB2.</p>
  
  <pre><code>create procedure checkUpdate()
  LANGUAGE SQL
  begin 
  DECLARE EOF INT DEFAULT 0;
  DECLARE STMT VARCHAR(200);
  DECLARE COL_NAME NVARCHAR(40);
      Declare col_name_cursor cursor  for 
      select c.column_name from sysibm.tables t join sysibm.columns c on t.table_schema =   c.table_schema and t.table_name = c.table_name where t.table_schema ='ARCHANA' and t.table_name =   'ADULT'  and c.data_type not like 'CHARACTER%';
      DECLARE CONTINUE HANDLER FOR NOT FOUND SET EOF = 1;
      OPEN col_name_cursor;
      WHILE EOF = 0 DO
      FETCH FROM col_name_cursor INTO COL_NAME;
      INSERT INTO GAUSSIAN_VALUES select CLASS,avg(COL_NAME),stddev(COL_NAME) from ADULT GROUP BY CLASS;
      END WHILE;
      CLOSE col_name_cursor;
      end@
  </code></pre>
  
  <p>However, I get the following error while executing this on the DB2 command window.</p>
  
  <p><strong>SQL0420N  Invalid character found in a character string argument of the function "DECFLOAT".  SQLSTATE=22018</strong></p>
  
  <p>I did some debugging to find that the error comes from the Declare cursor line.  I changed the select statement for the cursor to "select age from adult" for checking and the error disappeared. The error does not occur when integer values are selected. Occurs in the case of varchar. I am stuck and do not know what is the link missing here.</p>
  
  <p>Thank You! </p>