views:

1862

answers:

3

In MS SQL Server it is possible to create a foreign key with ON UPDATE CASCADE option, so whenever you update one of the columns in the primary key, the foreign keys in other tables will also be update by the DBMS.

So, how to do it in Oracle?

+3  A: 

Some good help here...

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11%5FQUESTION%5FID:5773459616034

cagcowboy
I'd like to emphasize Tom's suggestion about ON UPDATE CASCADE requirement - *CHANGE YOUR DESIGN NOW IF YOU CAN!* (and save yourself some headache)
jva
A: 

Would a database trigger do the job for you ?

Here is the Oracle doc on the subject of Data Integrity for 11g (just incase you were interested).

caddis
A: 

Oracle does not allow a Foreign Key constraint with “ON UPDATE CASCADE”.

Here are a couple of options you have.

Create the Foreign Key, and create an “On Update” trigger. Make use of the package below (needs to be installed in the db).

http://asktom.oracle.com/tkyte/update%5Fcascade/index.html

Let me know if you have additional questions or need more information.

Kombucha