Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: MASTER-DETAIL UPDATE

Re: MASTER-DETAIL UPDATE

From: Julio <julio.negueruela_at_si.unirioja.es>
Date: 1998/03/09
Message-ID: <35045C94.572F@si.unirioja.es>#1/1

  1. Elliot Gibbons wrote:
    >
    > Problem:
    >
    > Is it possible to carry out an update which 'cascades' from
    > one table to another as per the 'on delete cascade' used when
    > defining foreign keys?
    >
    > Table Structure:
    >
    > TABLE_1 (MASTER)
    > ID_1 PRIMARY KEY
    >
    > TABLE_2 (DETAIL)
    > ID_1 PRIMARY KEY
    > ID_2 PRIMARY KEY
    >
    > FOREIGN KEY ON TABLE_2.ID_1 REFERENCES TABLE_1.ID_1
    [...]

Have you tried this way?

Disable the constraint executing:
ALTER TABLE TABLE_2 DISABLE CONSTRAINT <The constraint that fails>; then update table_1 and every row in table_2 that references the row you've updated in table_1. But be sure to update the right rows. And finally ALTER TABLE TABLE_" ENABLE CONSTRAINT <the same one>

If you've updated them correctly there should not be any problem.

Regards.

-- 
Julio Negueruela
mailto:julio.negueruela_at_si.unirioja.es
Received on Mon Mar 09 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US