I was enabling a constraint and I got this error message. Can any one tell me the spacific way to solve it?
ORA-02298: cannot validate (DAN.FK_DAN_ROL_DA_ONE) - parent keys not found
one/more rows are missing in the parent table.
I did not drop any rows in the tables so your suggestions sound incorrect.
I checked the error docs and found this:
ORA-02298 cannot validate (string.string) - parent keys not found
Cause: An ALTER TABLE ENABLE CONSTRAINT command failed because the table has orphaned child records.
Action: Make sure that the table has no orphaned child records before issuing an ALTER TABLE ENABLE CONSTRAINT command. For more information about ALTER TABLE and ENABLE CONSTRAINT, see Oracle8i SQL Reference.
But I do not know how to apply it. Can any one help?
You must either insert the parent data as Kishore suggested, or you can enable the constraint with the novalidate option:
alter table xyz modify constraint abc enable novalidate
Click Here to Expand Forum to Full Width