Start of change

-303   A VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER position-number BECAUSE THE DATA TYPES ARE NOT COMPARABLE

Explanation

A CALL, FETCH, SELECT, VALUES INTO, or SET statement with an output host variable could not be performed because the data type of a variable was not compatible with the data type of the corresponding SELECT, VALUES INTO, or SET statement list element.

position-number
Location of the host variable value in the output SQLDA.

The values of the output host variable and the corresponding list element must be in one of the following categories:

  • One value is numeric and one of the following conditions is true:
    • The other value is also numeric.
    • The other value is a character string.
    • The other value is a graphic string and uses Unicode.
    • The statement has a subtype of FOR BIT DATA.
  • Both must be character strings, unless you are using Unicode.
  • Both must be graphic strings, unless you are using Unicode.
  • Both must be row IDs.
  • Both must be binary strings, or one can be BINARY or VARBINARY, and the other can be FOR BIT DATA.
  • A variable is XML or binary XML and the corresponding statement list element is XML.

In addition, for datetime or timestamp values, the target host variable must be a character string variable with a correct length.

System action

The statement was not executed. No data is retrieved.

Programmer response

Verify that table definitions are current, and that the target variable has the correct data type.

SQLSTATE

42806

End of change