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: Trigger for cascading deletes failing

Re: Trigger for cascading deletes failing

From: Hello <Hello_at_yahoo.com>
Date: Tue, 07 Mar 2000 11:55:29 -0800
Message-ID: <38C55EB1.6B20E184@yahoo.com>


Ah, I see what you are saying.
So, Oracle protects it's data integrity by not allowing Orphan records....that makes perfect sense.
I think this "workaround" was implemented because there was a case for one of the triggers where the parent and child were in the same table, thus you would get the "mutating table" error message. Thanks for the help.

Alan Shein wrote:

> You are trying to delete a "child" record and cascade the deletion upward to
> the "parent". Can't do that. You need to delete the "parent" record and have
> the deletion cascade downward to the "child" record. For example, suppose
> you have an invoice/line item situation. The invoice table is the parent,
> and the line items are children. What you are tring to do now is delete the
> parent (invoice record) just because you deleted one child (line item). The
> other children (line items) become orphans (they have no invoice record to
> belong to.)
>
> You would need to delete the invoice record and cascade the deletes to the
> line items.
>
> OR, you need a more sophisticated program that would take manage the reverse
> process by keeping track of the invoice number of the line item, find all
> other line items belonging to that invoice, delete those line items, and
> then delete the invoice record.
>
> Hello wrote in message <38C54FA1.75B200C8_at_yahoo.com>...
> >Running Oracle 8.0.5.2 on Solaris 2.7
> >
> >I am trying to implement a trigger given to me by developers that does
> >cascading deletes.
> >When testing through the java based application, I am receiving the
> >following error message: (sorry, no Oracle number given).
> >
> >Attempt to orphan detail rows from <Table_name>. Master rows that have
> >detail rows linked to them cannot be deleted or have their linking
> >columns
> >modified when cascading deletes and/or updates are disabled.
> >I've looked, but I can't find what would cause this error, nor what can
> >be done to correct it.
> >
> >Any ideas?
> >
> >TIA for any help
> >
Received on Tue Mar 07 2000 - 13:55:29 CST

Original text of this message

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