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: delete cascade & trigger

Re: delete cascade & trigger

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Thu, 31 Jul 2003 08:53:32 -0700
Message-ID: <3F293B7C.9C683549@exxesolutions.com>


mitt wrote:

> Daniel Morgan wrote:
> > mitt wrote:
> >
> >
> >>Daniel Morgan wrote:
> >>
> >>>mitt wrote:
> >>>
> >>>
> >>>
> >>>>Hi,
> >>>>
> >>>>I have a table with an on-delete-cascade foreign key;
> >>>>in the row-level delete trigger I need to know, whether it fired because
> >>>>of a delete command on the table itself or if it was due to a
> >>>>"recursive" delete on the (grand-)father table;
> >>>>
> >>>>is there a way to accomplish this (in version >=8.1.7.4)?
> >>>>I know that this need hints at bad application design, but...;
> >>>>
> >>>>THX
> >>>
> >>>
> >>>It more than hints. But more importantly ... why? What difference does it
> >>>make? The answer to this question is not just rhetorical ... but may point
> >>>to the solution.
> >>>
> >>>My instinct is that you have two entities performing the same task. Drop one
> >>>of them: I'd modify the foreign key.
> >>>--
> >>>Daniel Morgan
> >>>http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
> >>>damorgan_at_x.washington.edu
> >>>(replace 'x' with a 'u' to reply)
> >>>
> >>>
> >>
> >>those 2 tables belong to some other application(s) I have no influence
> >>on; the delete trigger (installed as part of our application) records a
> >>lot of information calculated in this trigger into one of our tables,
> >>which is analyzed later on by our application;
> >>the kind of processing done with this information very much depends on
> >>the "original cause" of the trigger-fire-event caused by some unkown
> >>delete statements done by that other applications;
> >>I'd like to record the reason for trigger-firing in our table in order
> >>to be able to react/branch processing in our application;
> >
> >
> > Then deal with it on the application side. If you are deleting a parent ... you
> > know what you are doing and have your application handle it accordingly.
> >
> > --
> > Daniel Morgan
> > http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
> > damorgan_at_x.washington.edu
> > (replace 'x' with a 'u' to reply)
> >
> >

>

> it is not MY application that deletes, but a number of 3rd-party apps
> (not modifyable); I have read-only access to those parent-child tables;
> in fact my application's purpose is some kind of surveillance of those
> tables and notify again some other applications, depending on what kind
> of delete actions are going on those tables;

Then I'd chalk this one up to poor decision making in purchasing third-party apps by not fully evaluating them and perhaps management will ask tougher questions next time.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Thu Jul 31 2003 - 10:53:32 CDT

Original text of this message

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