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 problem

Re: Trigger problem

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Fri, 04 Mar 2005 09:34:08 -0800
Message-ID: <1109957461.989690@yasure>


Holger Baer wrote:

> Cris Carampa wrote:
>

>> Holger Baer wrote:
>>
>>> The best way would have been if the only way to delete a row in 
>>> myTable was
>>> through a package/stored procedure - that avoids the trigger problem 
>>> altogether.
>>
>>
>>
>> When I encounter this problem I usually create a view that mirrors the 
>> table, then I put all the logic in an INSTEAD OF trigger and expose 
>> the view - not the table - to the application. In that way I can do 
>> everything I want in the trigger :) Of course this is not an orthodox 
>> approach but it works for me. I hope it doesn't have side effects (I 
>> haven't experienced any so far).
>>
>> Kind regards,
>>

>
> Sure, that's possible, but over the last few years I've developed a
> deep dislike of any application that's not using stored procedures -
> I believe I read on asktom once that Tom Kyte considers a client
> application
> that has select, insert, update, delete somewhere in the code as
> a bug waiting to happen. Since then none of my applications do
> DML directly and guess what: in one case I had to frequently change
> the Workflow over the last year but I could do that without a single
> change to the client code.
>
> Cheers,
>
> Holger

I would agree though I would consider the instead-of trigger code a reasonably good surrogate for the packaged procedures. Still my preference is the same as yours in almost all cases.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Fri Mar 04 2005 - 11:34:08 CST

Original text of this message

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