Hi Losing,
You have the usual way to verify if a variable is numeric, and that would be to use a regexp:
unless ($val1=~/\A[-+]?\d+\.?\d*\Z/) {
#quote here $val1, for example:
$val1=$dbh->quote($val1);
}
I'm obviously, assuming that $dbh->quote for a DB2 connection don't quote the values correctly, that I think should happen.