Home » SQL & PL/SQL » SQL & PL/SQL » Using Like with :new.val ?
Using Like with :new.val ? [message #4388] Wed, 04 December 2002 09:37 Go to next message
Joe
Messages: 138
Registered: November 1999
Senior Member
I have a trigger that is not firing, I assume that my like statement is not correct but am not having any luck on the solution. The trigger looks like this...

create trigger trig1
after insert or update of val on table1
for each row
begin
update table2 set tn = tn
where tn like ':new.val';
end;
Re: Using Like with :new.val ? [message #4393 is a reply to message #4388] Wed, 04 December 2002 11:39 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
What is the purpose of this update? You are just setting the value of a column to itself. Also, the single quotes around :new.val are not needed (it is looking for the literal string ':new.val' - not the value of :new.val. If :new.val does not contain %, you should use = instead.

create or replace trigger trig1
after insert or update of val on table1
for each row
begin
  update table2
     set tn = 'updated'  -- something other than tn I would think...
   where tn = :new.val;
end;
/
Previous Topic: update query
Next Topic: Index using doubt
Goto Forum:
  


Current Time: Wed May 15 08:07:23 CDT 2024