Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Avoiding recursive triggering
You can use something like:
create ...
change_date date;
begin
SELECT ROUND(SYSDATE) into change_date FROM DUAL;
:new.date_changed := change_date;
end;
--
Have a nice day
Michel
Morten Primdahl <morten_at_caput.com> a écrit dans le message :
384E3438.77870FF1_at_caput.com...
>
> Howdy.
>
> Is there a way I can avoid recursive triggering?
>
> CREATE OR REPLACE TRIGGER upd_trg_table
> AFTER UPDATE ON table
> FOR EACH ROW
> BEGIN
> UPDATE table SET date_changed = (SELECT ROUND(SYSDATE) FROM DUAL)
> WHERE id = :old.id;
> END;
>
> I haven't tested the above trigger, but it looks
> recursive to me. Is there some standard way to avoid
> a such recursion?
>
> Thanks,
>
> Morten
>
> --
> Morten Primdahl Caput ApS Tel +45 33 12 24 42
> morten_at_caput.com Nygade 6 Fax +45 33 91 24 42
> http://www.caput.com DK-1164 Kbh K
Received on Wed Dec 08 1999 - 05:43:01 CST
![]() |
![]() |