Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: I need to update 30.000 rows - it must be fast.
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
![]() |
![]() |