/*
确认数据(涨后的薪水不能少于涨前的薪水)
*/
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;
确认数据(涨后的薪水不能少于涨前的薪水)
*/
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;
本文探讨了在数据库管理系统中使用SQL触发器来确保员工涨薪不会低于原薪金的策略,通过实现一个特定的触发器,确保薪酬调整的合法性与公平性。
1197

被折叠的 条评论
为什么被折叠?



