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

Explanation

A CALL, FETCH, SELECT, VALUES INTO, or SET assignment-statement statement with an output variable could not be performed because the data type of a variable was not compatible with the data type of the source value in the statement. For more information, see Assignment and comparison.

position-number
Location of the variable in the statement.

The values of the target variable and the corresponding source value 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 the correct length.
  • For array values, see Assignment and comparison.

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