Fwd: updating problems

  • From: "Simone Saravalli" <s.saravalli@xxxxxxxxx>
  • To: oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 5 May 2006 14:42:23 +0200

---------- Forwarded message ----------
From: Simone Saravalli <s.saravalli@xxxxxxxxx>
Date: 5-mag-2006 14.40
Subject: Re: updating problems
To: Ghassan Salem <salem.ghassan@xxxxxxxxx>


2006/5/5, Ghassan Salem <salem.ghassan@xxxxxxxxx>:
Simone,
Can you post the code of your trigger?


Yes, this is an example of the table I want to update:

create table tab (
  a number not null,
  b date default current_timestamp
);

and then the trigger

create or replace trigger my_trig
  after update of a on tab for each row
  begin
     update tab set b = current_timestamp where a=:new.a;
  end;
/

Now I've written:

create or replace trigger my_trig
  after update of a on tab for each row
  begin
     update tab set :new.b = current_timestamp where a = :new.a;
  end;
/

but the trigger gets some compilation errors. Is it correct?

Thanks, Simone Saravalli
--
//www.freelists.org/webpage/oracle-l


Other related posts:

  • » Fwd: updating problems