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: Are Triggers Really that Bad or ....???

Re: Are Triggers Really that Bad or ....???

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 25 Jul 2002 15:01:10 +0100
Message-ID: <3d4004a6$0$8510$ed9e5944@reading.news.pipex.net>


If you use them to enforce the business rule "we must always know who last updated this data and when" then storing them in the application doesn't help whenever you access the data in some other way (data loads through a second app commissioned in a years time etc etc).

In general business rules to protect the data should be stored as close to the data as possible, business rules to aid the app should be stored in the app. Sometimes this measn writing the same code twice.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
"Ronnie Yours" <ronnie_yours_at_yahoo.com> wrote in message
news:ahov3n$fek$1_at_nntp-m01.news.aol.com...

> Thanks a Lot guys,
> What are the reasons why each one of you and my Senior Developer supports
> this kind of functionality in Triggers and not the Code itself.
> I understand from your replies that nowadays triggers are not that Bad an
> dont affect the performace as I was thinking. But such a thing should
still
> be in the Code and not the Database.
>
> Please note that I have to insert/update the columns in the same
> transaction. I am not trying to preserve the old rows or maintaining a
audit
> in a different table.
>
> Please suggest
> Thanks
> Ronnie
>
>
>
>
>
> "Ronnie Yours" <ronnie_yours_at_yahoo.com> wrote in message
> news:ahmsm4$gd5$1_at_nntp-m01.news.aol.com...
> > Hi,
> >
> > I am facing a wierd situation here.
> >
> > We have a database with around 150-200 Tables and growing . Each Table
> has
> > 4 columns in additional to the ones for the application, namely
> > created_by, created_date,updated_by and updated_date.
> > Now when writing the application code the developers were supposed to
take
> > care of the values in these fields. For example when a record is
> > added/inserted the created_by and created_date fields are populated and
> when
> > the records are updated the updated_by and updated_dates are
> > populated/updated.
> > But the issue is the developeres did not take care of this issue and one
> of
> > the senior developers is suggesting that lets create triggers to
implement
> > this functionality.
> >
> > My suggestion was and is that lets change the code to take care of this
> but
> > he doesnt agree. He says it will take more time to do that.
> >
> > Now I am in a dilemma.
> >
> > If we implement triggers how will they affect the prformance.
> > If I should not implement triggers then how should I go about handling
> this
> > situation and explain the same to my manager.
> >
> > Please Suggest
> >
> > Thanks
> > Ronnie Yours
> >
> >
>
>
Received on Thu Jul 25 2002 - 09:01:10 CDT

Original text of this message

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