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


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 -546

   
 
  • Causa
    • THE CHECK CONSTRAINT constraint-name IS INVALID.

      A check constraint in the CREATE TABLE or ALTER TABLE statement is invalid for one or more of the following reasons:
      • The constraint definition refers to a column that has a field procedure.
      • The constraint definition refers to a column with a data type that is lower in the hierarchy of numeric data types than the data type of any other operand.
        The hierarchy is as follows:
                              small integer < large integer < decimal  
                              < single precision float 
                              < double precision float
                          
      • The constraint definition refers to a column with a numeric data type that is not the same numeric data type as that of the other column operands.
      • The constraint definition refers to a column with a length that is shorter than the other operands when the column and other operands are not character string data types.
      • The constraint definition refers to a DECFLOAT column.
      • The constraint definition refers to a Unicode column in an EBCDIC table.
      • The constraint definition refers to a built-in or user-defined function.
      • The constraint definition uses a cast function that requires conversion of the data.
        The only functions that are allowed in a check constraint are cast functions that do not require conversion of the data.
      • The constraint definition contains a global variable.
      • The constraint contains an XML column
      • The constraint definition contains an XMLQuery expression.
      constraint-name
      The name of the check constraint.
  • Ação do sistema
    • The statement is not executed.

      For ALTER TABLE, the check constraint is not added to the object table.
      The definition of the table is unchanged.

      For CREATE TABLE, the table is not created.
  • Resposta ao Desenvolvedor
    • Correct the check constraint definition and execute the statement again.

      SQLSTATE: 42621

© Copyright IBM Corp.