I have two tables
Department
Professor
in which Department
has an attribute called HeadID
referencing Professor
and Professor
has an attribute called DeptID
referencing Department
They form a circular relationship.
But the problem is that, how to insert a row to any of these tables?
Oracle complained "parent key not found" after I tried insert a row.
You can define one of the foreign key constraints as DEFERRABLE and defer constraint checking until the end of your transaction (instead of checking at the end of the statement, which ends with "parent key not found"). Read here.