Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Updating foreign keys problem.
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 - 06:46:36 CST
![]() |
![]() |