Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> parent keys not found?
hello,
I am trying to add a foreign key to a table but I receive:
SQL> ALTER TABLE PLATI ADD CONSTRAINT fk_PLATI_pid FOREIGN KEY (pid)
REFERENCES PRIMA (pid);
ALTER TABLE PLATI ADD CONSTRAINT fk_PLATI_pid FOREIGN KEY (pid)
REFERENCES PRIMA (pid)
*
ERROR at line 1:
ORA-02298: cannot enable (DNTB.FK_PLATI_PID) - parent keys not found
The parent key exists and is enabled. Is there anything elese I should do?
TIA -vsv
SQL> select * from all_constraints where constraint_name='PK_PRIMA_PID';
OWNER CONSTRAINT_NAME C TABLE_NAME SEARCH_CONDITION R_OWNER R_CONSTRAINT_NAME DELETE_RU STATUS DEFERRABLE DEFERRED VALIDATED GENERATED BADLAST_CHAN
------------------------------ ------------------------------ - ------------------------------ -------------------------------------------------------------------------------- ------------------------------ ------------------------------ ----------------- -------------- --------- ------------- -------------- ---
DNTB PK_PRIMA_PID P PRIMA ENABLED NOT DEFERRABLE IMMEDIATE VALIDATED USER NAME02-DEC-99 Received on Thu Dec 02 1999 - 04:12:08 CST