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

Re: Trigger for cascading deletes failing

From: Alan Shein <alanshein_at_erols.com>
Date: 2000/03/07
Message-ID: <8a3l3t$eo4$1@bob.news.rcn.net>#1/1

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 - 00:00:00 CST

Original text of this message

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