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: Enforcing hierarchial tree integrity

Re: Enforcing hierarchial tree integrity

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 28 Jul 2005 15:05:53 -0700
Message-ID: <1122588320.825828@yasure>


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

Original text of this message

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