logo  
Google
 

DB2 SQL-Error: -331

SQLState: 22021

Short Description: CHARACTER CONVERSION CANNOT BE PERFORMED BECAUSE A STRING POSITION CANNNOT BE CONVERTED FROM TO REASON

The operation required the conversion from source-ccsid to target-ccsid and a conversion error occurred. The type of error is indicated by the reason-code: v 8 for length exception (for example, expansion required for PC MIXED data exceeds the maximum length of the string). v 12 for invalid code-point (for example, use of the ERRORBYTE option of SYSSTRINGS). v 16 for form exception (for example, invalid MIXED data). v 20 for conversion procedure error (for example, an exit set the length control field of the string to an invalid value). You can find the procedure name in SYSIBM.SYSSTRINGS row with INCCSID=source-ccsid and OUTCCSID=target-ccsid in the TRANSPROC column. The position-number, if provided (non-zero), is the ordinality of the output variable in the SQLDA. System action: The statement cannot be executed. Programmer response: Take one of the following actions based on the reason-code: v If the reason-code is 8, the maximum length of the result column must be extended to allow for the expansion that occurs when the string is converted. v If the reason-code is 12, either the conversion table must be changed to accept the code-point or the data must be changed to eliminate the code-point. v If the reason-code is 16, and the string is described as MIXED data, either its description must be changed or the string must be changed to conform to the rules for well-formed MIXED data. v If the reason-code is 20, the conversion procedure must be corrected. An alternative to these corrective actions is to provide an indicator variable so that a null value and a warning can be returned rather than an error. Refer to Chapter 2 of DB2 SQL Reference for more information on coded character set.

 <-  BACK TO INDEX