Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Trigger Help
A copy of this was sent to "Mark Young" <mark_a_young_at_worldnet.att.net>
(if that email address didn't require changing)
On Thu, 22 Jul 1999 15:35:43 -0400, you wrote:
>I would like to return the value of a field back to 0 once the value reaches
>1000 using a trigger
>
>I have the following:
> if (:new.senumber=1000) then
> begin
> update mytable set senumber=0 where mycondition=mycondition
> end;
> end if;
>
create or replace trigger SomeTrigger
before update of senumber on TableName
for each row
begin
if ( :new.senumber = 1000 ) then
:new.senumber := 0;
end if;
end;
/
>The trigger will be executed on an update of the senumber column.
>
>Any help would be greatly appreciated.
>
>mark_a_young_at_worldnet.att.net
>
>
>
>
--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Jul 22 1999 - 15:15:09 CDT
![]() |
![]() |