Results 1 to 3 of 3

Thread: update

  1. #1
    Join Date
    Jul 2002
    Posts
    6

    Unanswered: update

    is there a way to inherit updates made on key attributes to other tables that use the changed attributes as foreign key?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    what you're looking for is ON UPDATE CASCADE

    i'm not sure if that's part of the SQL standard, but in any case it wouldn't matter

    what matters is that oracle does not support it (last time i looked)

    you will need to write a stored procedure or trigger

    rudy
    http://rudy.ca/

  3. #3
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482

    Cool

    I agree, there is still no such ability in Oracle RDBMS. However, that is easy to do:

    1. You can disable the foreign key constraints in all the child tables and update the PK value. Then update all child tables to reflect this new value. Now re-enable the FK constraints in all child tables.

    2. If you define the FK constraints in the child tables as INITIALLY DEFERRED, you can straight away update the PK value and all child tables in one transaction.

    Hope that helps,

    clio_usa
    OCP DBA
    Visit our Web Site
    .
    .
    .

Posting Permissions

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