Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Enforcing hierarchial tree integrity
Peter Griffin wrote:
> I have some tables that store hierarchical data, just wondering what is
> a good way to enforce integrity on the database side.
>
> The problem, deleting a node with children will result in the orphaning
> of those nodes. It's easy enough to do client-side but what I'd like to
> do is keep the integrity logic on the server-side.
>
> Basically, when a node is deleted then all of it's children (if any)
> should get deleted too. I suspect this needs to be done using a delete
> trigger.
>
> Just thought I'd run it by this group in case anyone has already done this.
Foreign key constraint with ON DELETE CASCADE.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Thu Jul 28 2005 - 17:05:53 CDT
![]() |
![]() |