SQL - SQLCODE's - Códigos negativos -331


Volta a página anterior

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

SQLCode -331

   
 
  • Causa
    • A STRING CANNOT BE ASSIGNED TO A HOST VARIABLE BECAUSE IT CANNOT BE TRANSLATED.
      REASON reason-code, CHARACTER code-point, POSITION position-number

      The operation required the translation of a string to the coded character set of the host variable and a translation error occurred.
      The type of error is indicated by the 'reason-code':
      • 8     for length exception (e.g., expansion required for PC MIXED data exceeds the maximum length of the string).
      • 12   for invalid 'code point' (e.g., use of the ERRORBYTE option of SYSSTRINGS).
      • 16   for form exception (e.g., invalid MIXED data).
      • 20   for translate procedure error (e.g., an exit set the length control field of the string to an invalid value).

      If the 'reason-code' is 12, 'code-point' is the invalid 'code point'.
      Otherwise, 'code-point' is blank. The 'position-number' is the ordinality of the output variable in the SQLDA.
  • Ação do sistema
    • The statement cannot be executed.
  • Resposta ao Desenvolvedor
    • 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 translated.
      If the 'reason-code' is 12, either the translate table must be changed to accept the 'code-point' or the data must be changed to eliminate the 'code point'.
      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.
      If the 'reason-code' is 20, the translate 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.

      SQLSTATE: 22021

© Copyright IBM Corp.