Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle l »

Re: updating problems

Giovanni Cuccu

2006-05-05

Replies:

Ciao Simone,
  you can update the column values using Pl/SQL code not a SQL command
here is an example very close to your requirements:

create or replace trigger NtfRcpt_lastUpdate
before insert or update on Notifications_Recipients
for each row
declare
-- local variables here
begin
 :new.Last_Update:=sysdate;
end check_enabled;
/
Hope it helps,
  Giovanni



On 5/5/06, Simone Saravalli <s.saravalli@(protected):
> Hi all, I've got a table with two columns (say column A and column B).
> The B data type is date and its default value is CURRENT_TIMESTAMP.
> When I make an update on col A I would like to update also B with a
> new current_timestamp value, so I created a trigger that fires after
> an update on A but I obtain an error, in fact when the trigger tries
> to update col B it says that it's impossible because the table is
> updating col A.
> How can I solve this problem?
>
> Thanks, Simone Saravalli
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>


--
--------------------------------------------------------------------
Another free oracle resource profiler
http://sourceforge.net/projects/oraresprof/
Now version 0.9
--
http://www.freelists.org/webpage/oracle-l


©2008 dba.5341.com - Jax Systems, LLC, U.S.A.