| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: "ON DELETE CASCADE" references more than one table
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...Received on Mon Mar 03 2003 - 03:16:43 CST
> 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.
![]() |
![]() |