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: Cascade deleting

Re: Cascade deleting

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Tue, 25 Sep 2001 08:39:30 +0100
Message-ID: <3bb034c9$0$232$ed9e5944@reading.news.pipex.net>


Oops sorry you are of course correct. I was wrong (again).

--
Niall Litchfield
Oracle DBA
Audit Commission UK
"Michel Cadot" <micadot_at_netcourrier.com> wrote in message
news:9onggk$f9c$1_at_s1.read.news.oleane.net...

>
> "erton" <aerton_at_poczt.onet.pl> a écrit dans le message news:
9onf56$bvh$1_at_news.onet.pl...
> > Hi
> >
> > I have a table, which is composed of two fields:
> > -ID
> > -ParentID
> > I would like to make cascade deleting (deleting record with ID x cause
> > deleting all records which have ParentID equal to x). How can I do it? I
> > have tried to do it in a trigger and by constraints but it doesn't work.
> >
> > Thanks
> >
>
> If you have a primary key on the column id you can add a
> foreign key:
>
> alter table my_table add constraint fk foreign key (parentid)
> references my_table (id) on delete cascade;
>
> --
> Have a nice day
> Michel
>
>
>
>
Received on Tue Sep 25 2001 - 02:39:30 CDT

Original text of this message

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