输入banner图图片脚本导航/分类

ORACLE简单触发器

before insert on fin_opb_accountcard
for each row
begin
if :new.card_no = 0 then
RAISE_APPLICATION_ERROR(-20001,‘card_no为0,无法插入fin_opb_accountcard‘);
end if;
end ;

  触发器作用在对fin_opb_accountcard表进行insert操作前,判断新加入的数据中card_no是否为0,若为0,RAISE_APPLICATION_ERROR方法会提示报错,注意方法中有两个参数,错误编号和错误信息。

ORACLE简单触发器

标签: