我执行下面这段代码之后没有出错,然后更新cusinfo表,想要回滚主事务的操作,但是这里提示说不能再触发器使用rollback(使用子事务也没什么用)
create or replace trigger forbid_insert_update_cusinfo --触发器,通过cusinfo表的FILINGMAN或CHARGEMAN列值是否存在于userinfo表中,若存在插入,若不存在就rollback
before update or insert of filingman,chargeman on cusinfo
for each row
declare
v_countf number;
v_countc number;
begin
select count(*) into v_countf from userinfo where username=:new.filingman;
select count(*) into v_countc from userinfo where username=:new.chargeman;
if v_countf=0 then--要注意,这里的判断不能写==
rollback;
elsif v_countc=0 then
rollback;
end if;
end;