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!

Foreign key Constraint updation

max88604Mar 6 2014 — edited Apr 3 2014

Hi ,

Can any one please explain me how to update child table values and parent table values linked through foreign key constraint in Oracle.

For example

Table 1   ( Key1  primary key )

Table 2  ( key 2  foreign key references Table1 (Key1)  )

Table 3   ( Key 3 foreign key references Table2 (key2) )

Table n  ( key n foreign key references Table n-1 (key n-1) )

Suppose Tabl1 1 has one row with key1 value as 1 and all dependent tables have multiple rows with key column value as 1

If i want to update Key1 of Table1 with value 2  (involves updating child table values down the hierarchy ), what is the most recommended/correct /safe way to do it if this is a requirement in live environment?

Please help giving some example .

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2014
Added on Mar 6 2014
12 comments
1,579 views