【发布时间】:2014-04-12 11:33:42
【问题描述】:
我正在尝试编写一个触发器,该触发器必须在插入之前限制为零工资。 我已经写了,但它不起作用。我收到一个错误,因为触发器无效并且重新验证失败。
代码:
create or replace trigger emp_sal
before insert or update on employee
referencing new as new old as old
for each row
begin
if :new.salary<=0 then
raise_application_error (-20999,’salary is zero’);
end if;
end;
/
请告诉我问题出在哪里。谢谢
【问题讨论】:
-
为什么不使用检查约束呢?