logo  
Google
 

DB2 SQL-Error: -546

SQLState: 42621

Short Description: THE CHECK CONSTRAINT IS INVALID

A check constraint in the CREATE TABLE or ALTER TABLE statement is invalid for one or more of the following reasons: v The constraint definition refers to a column that has a field procedure. v 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 v 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. v 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. v The constraint definition refers to a built-in or user-defined function. v 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.System action: 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. Programmer response: Correct the check constraint definition and execute the statement again.

 <-  BACK TO INDEX