-538 FOREIGN KEY name DOES NOT CONFORM TO THE DESCRIPTION OF A PARENT KEY OF TABLE table-name

Explanation

The definition of the indicated foreign key does not conform to the description of parent key of the indicated table due to one of the following reasons:

  • The referenced parent key has not been defined as a primary key or a unique key.
  • The keys do not have the same number of columns.
  • The description of the keys are not identical. The requirement for identical descriptions includes data type, length attribute, and field procedure.
  • Start of changePERIOD BUSINESS_TIME was specified for the child key in the FOREIGN KEY clause, but PERIOD BUSINESS_TIME was not specified in the parent key in the REFERENCES clause.End of change
  • Start of changePERIOD BUSINESS_TIME was specified for the parent key in the REFERENCES clause, but PERIOD BUSINESS_TIME was not specified in the child key in the FOREIGN KEY clause.End of change
  • Start of changePERIOD BUSINESS_TIME was specified for both the parent and child keys, but the semantic of the BUSINESS_TIME period in the two tables is not the same.End of change

name is the constraint-name specified in the foreign key clause or, if a constraint-name was not specified, the first column-name specified in the clause.

System action

The statement cannot be processed.

Programmer response

Correct the statement so that the description of the foreign key references a primary key or unique key, or so that the description of the foreign key conforms to that of a parent key of the indicated table.

SQLSTATE

42830