Re: Enforcing hierarchial tree integrity
- From: DA Morgan <damorgan@xxxxxxxxx>
- Date: Thu, 28 Jul 2005 15:05:53 -0700
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@xxxxxxxxxxxxxxxx (replace x with u to respond) .
- References:
- Enforcing hierarchial tree integrity
- From: Peter Griffin
- Enforcing hierarchial tree integrity
- Prev by Date: Re: How do I rename the storage area of a nested table?
- Next by Date: 'Help' Book Recommendations ?
- Previous by thread: Re: Enforcing hierarchial tree integrity
- Next by thread: 'Help' Book Recommendations ?
- Index(es):
Relevant Pages
|