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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Updating foreign keys problem.

Re: Updating foreign keys problem.

From: XXX <XXXX_at_XXX.XXX>
Date: Thu, 24 Feb 2000 15:00:55 +0100
Message-ID: <893den$n85$1@scesie13.sie.siemens.at>


Hi
And what use the before_insert_trigger on database where you will insert a getting value from insert to detail table to master table?

vaclav.svara_at_anfdata.cz

Ivan Nilsson <dumb_at_nospam.com> píse v diskusním příspěvku:GF9t4.5651$7f7.12494_at_nntpserver.swip.net... I have two tables:

CREATE TABLE Customers
(Cno VARCHAR2(5) CONSTRAINT pk_cno PRIMARY KEY,
Name VARCHAR2 (30));

CREATE TABLE Orders
(Ono VARCHAR2(5) CONSTRAINT pk_ono PRIMARY KEY,
Cno CONSTRAINT fk_cno REFERENCES Customers(Cno) ON DELETE CASCADE); Contents of Customers:
Cno Name

12     Big Company Inc
13     Another Company Ltd

Contents of Orders:
Ono Cno
100 12
101 13
102 12

When the value of Cno 12 is update to 15 in the Customers table I also want the value of Cno updated to 15 on orders 100 and 102 in the Orders table:

Contents of Customers:
Cno Name
15 Big Company Inc
13 Another Company Ltd

Contents of Orders:
Ono Cno
100 15
101 13
102 15

Oracle disallows this.

Isn't there a clause such as ON UPDATE CASCADE to do this? I have read the on-line manual for hours without finding anything useful on this issue.

I'll appreciate any help.

/TIA
Ivan Nilsson Received on Thu Feb 24 2000 - 08:00:55 CST

Original text of this message

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