确认数据(涨后的薪水不能少于涨前的薪水

/*
确认数据(涨后的薪水不能少于涨前的薪水)
*/
create or replace trigger checksal
before update
on emp
for each row
begin

  if :new.sal < : old.sal then
    raise_application_error(-20001,'涨后的薪水不能少于涨前的薪水.涨前:'||:old.sal||' 涨后:'||:new.sal);
  end if;

end;

猜你喜欢

转载自apple578994358gg.iteye.com/blog/2086454