Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update a primary key and Fk

Rosario VigilanteSep 7 2007 — edited Sep 7 2007
Hello

I have to update a primary key (PK) which is referenced by many foreign keys (FK).
The primary key columns cannot be updated as this would orphan the dependant tables,
and the dependant tables cannot be updated prior to the parent table as this would also make them orphans.
I think this problem was solved by disabling the foreign key constraints or deleting the original records and recreating them.
Since neither of these solutions is particularly satisfactory for me I read about 'deferred constraints'.

My question is:
Can I use(modify to) 'INITIALLY DEFERRED' keyword on constraints's table already created with The default, INITIALLY IMMEDIATE ,
that is, update my primary key and foreign keys, and then re-set to
'INITIALLY IMMEDIATE'? Or another trick exists ?

Thanks in advance for your attention
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 5 2007
Added on Sep 7 2007
7 comments
2,550 views