Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
create or replace trigger trg_m_service
after update on m_service
for each row
declare
SQL
begin
 if updating(SRM_THEFT_CASE_STATUS)then
  update m_servicemaster@collection
  set srm_theft_tag@collection =:new.SRM_THEFT_CASE_STATUS,
  srm_theft_amt@collection =:new.srm_theft_amt,srm_modify_date=sysdate
  where :new.srm_service_no=srm_service_no@collection;
 end if;
end;
Posted
Updated 30-Dec-11 19:15pm
v2

You can use prefix :Old and :New to test if column value as changed

create or replace trigger trg_m_service
after update on m_service
for each row
Begin
If :Old.SRM_THEFT_CASE_STATUS != :New.SRM_THEFT_CASE_STATUS Then

-- your update

End If;

End;
 
Share this answer
 
SQL
begin
 if updating(SRM_THEFT_CASE_STATUS)then
  update m_servicemaster@collection
  set srm_theft_tag@collection =:new.SRM_THEFT_CASE_STATUS,
  srm_theft_amt@collection =:new.srm_theft_amt,srm_modify_date=sysdate
  where :new.srm_service_no=srm_service_no@collection;
 end if;
end;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900