Click here to Skip to main content
12,294,442 members (66,824 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Oracle
create or replace trigger trg_m_service
after update on m_service
for each row
declare
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 30-Dec-11 19:09pm
Edited 30-Dec-11 19:15pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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;
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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;
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 25 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100