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@xxxxxxxxxxxxxxxx (replace x with u to respond) .



Relevant Pages

  • Enforcing hierarchial tree integrity
    ... I have some tables that store hierarchical data, just wondering what is a good way to enforce integrity on the database side. ... deleting a node with children will result in the orphaning of those nodes. ...
    (comp.databases.oracle.server)
  • RE: Push Method - overwriting data
    ... If you are deleting records at the SqlCe Database, ... SQL Server and inserting the new records. ...
    (microsoft.public.sqlserver.ce)
  • Re: Subform not allowing edits?
    ... Creating and deleting fields. ... It's just possible that Name AutoCorrect is ... Make sure the boxes are unchecked under ... the database may be corrupting? ...
    (microsoft.public.access.forms)
  • Re: DoCmd.Close and DoCmd.DeleteObject
    ... Recreating the database does not make a difference unfortunately. ... be deleted was open when the second form was opened, ... I have no problems deleting the form manually! ... Danny ...
    (microsoft.public.access.formscoding)
  • Re: RE and Cascade Deletes
    ... all you get is a lousy message saying ... this database and delete the entire database ... working hard to prevent gaffs like this if a simple "Yes" sends you deleting ...
    (comp.databases.ms-access)