In this post, you’ll learn about the error message -303 a value cannot be assigned to output host variable number position-number because the data types are not comparable in the IBM DB2 database , the reason why it occurs along with the solution to fix it
IBM DB2 Error Message
-303 a value cannot be assigned to output host variable number position-number because the data types are not comparable
Reason for the Error
A FETCH or SELECT into the output host variable, whose entry in the output SQLDA is indicated by ‘position-number’, could not be performed because the data type of the variable was not compatible with the data type of the corresponding SELECT-list element.� The output host variable and the corresponding SELECT-list element must fall in one of the following categories:� *�� Both values must be numbers. *�� Both values must be character strings. *�� Both values must be graphic strings.� In addition, for datetime, and timestamp values, the host variable must be a character string variable with a proper length.
Solution
Verify that table definitions are current, and that the host variable has the proper data type.