Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Deleting from a related tables.
In article <9ifaci$1lq$1_at_news3.cadvision.com>, "Jeff says...
>
>Hey all,
>
>This is a very simple question I'm sure............. anyway, can anyone tell
>me the best way to delete a record that has data in related tables.
>Basically I need to know if there is a way to cascade a delete when deleting
>from the top table. I am using Oracle 8i as a backend for my online
>application. I need to allow the Admin to delete records.......
>
>Thanks ,
>Jeff
>
>
Use declaritive RI:
create table top ( x int primary key );
create table child ( x references top ON DELETE CASCADE );
That would be the best way.
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Tue Jul 10 2001 - 12:38:07 CDT
![]() |
![]() |