-20289   INVALID STRING UNIT unit SPECIFIED FOR FUNCTION function-name

Explanation

The statement invoked a built-in function using a string unit that is not valid with the type of data that is provided to the function. This can occur for the following reasons:
  • Binary data was specified with unit. CODEUNITS16, or CODEUNITS32 are not valid with binary string data.
  • Graphic data was specified with OCTETS as the string length unit. OCTETS is not valid with graphic data.

System action

The statement cannot be processed.

Programmer response

Change the invocation of the function to remove the invalid string length unit or change it to a valid unit for the data type being processed.

SQLSTATE

428GC