-408 THE VALUE IS NOT COMPATIBLE WITH THE DATA TYPE OF ITS TARGET. TARGET NAME IS name

Explanation

A statement failed required assignment rule checking.

name
The name of the target of the assignment.

The data type that is to be assigned is incompatible with the declared data type of the assignment target. Both data types must be:

  • Numeric or character
  • Character (see restriction)
  • Graphic (see restriction)
  • Dates or character (see restriction)
  • Times or character (see restriction)
  • Timestamps or character (see restriction)
  • Row IDs
  • The same distinct types
  • XML
  • Result set locator
  • Table locator
Restrictions:
  • Dates, times, and timestamps cannot be assigned to a character column that has a field procedure.
  • Character and graphic data types are compatible when using Unicode.
  • An array value with a user-defined array type can be assigned only to an array variable that is defined as the same user-defined array type.

    The rules for assigning an array value without a user-defined array type to an array variable depend on the statement that specifies the assignment. See User-defined type assignments for more information.

System action

The statement cannot be processed.

Programmer response

Examine the SQL statement and the current definition for the object table, procedure, user-defined function, host variable, or SQL variable, and ensure that the variable, constant, or result of an expression that is assigned to the object has the proper data type.

If the target is a result set locator, the application might have tried to explicitly assign an invalid locator value to a result set locator. Use the ASSOCIATE LOCATORS statement to get a valid locator value for a result set into a locator variable. Then, reference the result set locator in an ALLOCATE CURSOR statement.

SQLSTATE

42821