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: I need to update 30.000 rows - it must be fast.

Re: I need to update 30.000 rows - it must be fast.

From: Ashish Mittal <mittalashish_at_yahoo.com>
Date: Wed, 06 Mar 2002 14:44:38 GMT
Message-ID: <qXph8.11322$Hf7.31854@rwcrnsc51.ops.asp.att.net>


I would not advise you to use a trigger but build the logic for the alarm into the update statement - for example

update table_1 old
set (value,alarm)=
(select new.value,case when new.value between min and max then 0 else 1 end from new where new.id=old.id)

This should be significantly faster than a trigger. "Martin Forsberg" <forsberg_martin_at_hotmail.com> wrote in message news:Enmh8.5132$1h4.5892_at_news2.bredband.com...
> Here is my problem:
>
>
> An application updates a table in Oracle (8.17 on win2000).
>
> The application comunicate with Oracle trough ODBC.
>
> Every second minute the value is updated for 30.000 diffrent id's.
>
> I must check if the VALUE is between MIN AND MAX. If the value is out of
> range the
>
> value must be inserted anyway, but I need to know if the value is out of
> range.
>
>
> TABLE_1
> ---------
> ID
> MAX
> MIN
> VALUE
> ALARM (Now I use a trigger: ALARM = 1 if VALUE out of range)
>
>
> Is there a smarter solution? I must be very fast.
>
>
>
> /Martin
>
>
>
>
Received on Wed Mar 06 2002 - 08:44:38 CST

Original text of this message

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