ORACLE触发器中如何终止SQL语句的执行?

2025-03-23 05:52:30
推荐回答(4个)
回答1:

抛出异常,比如:

if new.col1 is null then
RAISE_APPLICATION_ERROR(-20001, 'col1 is null.');

end if;

回答2:

if 值 is null then
return;
else
insert.....;
end if;

回答3:

if :new.col1 is null then
rollback;
end if;

回答4:

少用触发器,效率低