Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: update triggers to update same table
Hi.
It is a wrong assumption.
Actually Oracle keeps 2 sets of row values in memory
and you update in trigger the :new set of values ( if
it is BEFORE trigger ).
On the other hand - Oracle will not allow you to execute
a trigger that access the same table which is currently
updated ( See MUTATING TABLE in APPLICATION
DEVELOPER's GUIDE ).
There is a nice solution in Oracle 8.x -
using INSTEAD OF trigger on VIEW during the update.
In Oracle 7.x - you must use temp. table / PL/SQL tables
and AFTER STATEMENT triggers to bypass it.
HTH. Michael.
In article <Pine.LNX.4.10.9910071343130.4122-
100000_at_ace.ulyssis.student.kuleuven.ac.be>,
Wim Derweduwe <kalimero_at_ace.ulyssis.student.kuleuven.ac.be> wrote:
>
>
> We have a table with a key1, key2, figure1, calcul1 fields.
>
> What I want to do is an update trigger that when a row is updated or
a new
> one is inserted that it calculates the calculated field calcul1
dpending
> on other row in that table.
>
> But what happens? As the lines is updated oracle starts the trigger
and
> updates the calculated field, so the row is again updated and it
starts
> again the trigger or is that a wrong consumption?
>
> Wim
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Oct 07 1999 - 15:39:06 CDT
![]() |
![]() |