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: "ON DELETE CASCADE" references more than one table

Re: "ON DELETE CASCADE" references more than one table

From: Henk Hultink <hhu_at_stopspam.stoas.nl>
Date: Mon, 3 Mar 2003 10:16:43 +0100
Message-ID: <3e631d7b$1@news.wau.nl>


I suggest you try building database triggers (Before Delete) on every table that has a relationship with the ADDRESS table. This trigger should delete the address when you delete the aemployee, contractor or...

regards,

Henk

--
H. Hultink
Software Engineer
Stoas, Division OBOI
Wageningen, The Netherlands
"Activating Knowledge"
http://www.stoas.nl

e-mail: hhu_at_stopspam.stoas.nl

"Wei Jiang" <_weijiang__at_yahoo.com> wrote in message
news:a2ba1fb3.0303020659.3503a56e_at_posting.google.com...

> Hi All,
>
> I have a table
>
> CREATE TABLE address (..., ownerId int, ...)
>
> I alse have many other tables, such as employee, contractor, vender....
All
> of these table can own an address.
>
> What is the best way to delete an address if I delete an employee or
contractor?
>
> I can not use
>
> FOREIGN KEY (customerId) REFERENCES customer (id)
>
> on address, because I can only reference customer, not employee or
contractor.
>
> Any information would be appreciated. Thanks in advance.
Received on Mon Mar 03 2003 - 03:16:43 CST

Original text of this message

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