oracle trigger 范了一个巨大的错误 递归了

CREATE OR REPLACE TRIGGER UPT_PARENTFUN
AFTER UPDATE
ON DAPS.UT_ROLEFUNC
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
v_parentid varchar2(50);
v_count number;
BEGIN
if :new.isactive != :old.isactive then -- 如果修改了isactive

if to_number(:new.isactive) = 1 then
-- 如果修改功能为有权限,判断父菜单是否有权限,如果没有改为有
select f.parentid into v_parentid from ut_funcitem f where f.id = :new.funcid;

--if(v_count < 1) then
update Ut_Rolefunc r set r.isactive = 1
where r.roleid = :new.roleid and r.funcid = v_parentid ;
----错误----
--end if;
end if;
end if;
END;
展开阅读全文

没有更多推荐了,返回首页