--循环
beginfor cycle in (select id, testcycle from specialpapers) loop
if (cycle.testcycle is null) then
update specialpapers set testcycle = 48 where id = cycle.id;
end if;
end loop;
end;
for循环,是一种隐式游标,效率比较高,编写使用方便。
--触发器create or replace trigger test
before insert or update on specialpapers
for each row
declare
-- local variables here
begin
if :NEW.Testcycle is null then
:NEW.Testcycle := 48;
end if;
end test;
--删除触发器
DROP TRIGGER test;
--授权用户 调试权限
GRANT debug any procedure, debug connect session TO username
来源:CSDN
作者:sensenlin91
链接:https://blog.csdn.net/sensenlin91/article/details/51066151