Start of change

-548   A CHECK CONSTRAINT THAT IS DEFINED WITH column-name IS INVALID

Explanation

A check constraint in the CREATE TABLE or ALTER TABLE statement is not valid 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 
      < big 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 ROWID column.
  • The constraint definition refers to a LOB column.
  • The constraint definition refers to a DECFLOAT column.
  • The constraint contains an XML column.
  • The constraint definition contains an XMLQuery expression.
  • An XMLQUERY or XMLEXISTS argument list contained two arguments with the same name.
  • The generated column expression references a column for a column mask is defined.
  • The constraint definition contains a built-in function that depends on the value of a special register.

System action

The statement cannot be processed.

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.

Programmer response

Correct the check constraint definition, and execute the statement again.

SQLSTATE

42621

End of change