Limitation when using DB2

When binding values using DB2®, a limitation exists because DB2 cannot determine the data type of the column to which the value is being bound at the time the SQL statement executes. Therefore, the data type of the value being passed must be explicitly specified. Because of this DB2 limitation, the DB2 adapter determines the data type of the value according to the following rule:

If the value contains only numeric characters or numeric characters with a decimal point, the value is assumed to be numeric; otherwise, the value is assumed to be text.

This rule provides the expected results in most cases; however, there may be some situations in which the rule may not apply and it may be necessary to specify the exact data type. For example, if the value is a text field consisting solely of numeric characters, the value will be incorrectly interpreted as numeric unless correctly specified.