Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136

    Red face Unanswered: ORA-02298: cannot validate (tablespace.FK_table1) - parent keys not found

    Hello!

    i have the following problem:

    1) i want to create this CONSTRAINT:
    ALTER TABLE TABLESPACE.table1
    ADD (
    CONSTRAINT FK_table1 FOREIGN KEY (COLUMN1)
    REFERENCES table2 (column) );

    2) but doing this i receive such an error message:

    ORA-02298: cannot validate (tablespace.FK_table1) - parent keys not found

    3) it would be great if somebody could help me!

    Thanks.

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    select xxxxx from child_table a where not exists (select 'x' from
    parent_table where primary_key = a.key_values);

    This will show you the row (or rows) that exists in the child table that
    don't exist in the parent table. Once you have either (added rows
    to the parent table to match the child rows) or (removed the child
    rows that don't have parents), then you can enable your RI constraints

    HTH
    Gregg

  3. #3
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136

    Thumbs up

    Thank you, Gregg!

    Now my constraint is working unobjectionably!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •