oracle For循环和触发器Tigger
生活随笔
收集整理的這篇文章主要介紹了
oracle For循环和触发器Tigger
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
--循環
begin? for 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
總結
以上是生活随笔為你收集整理的oracle For循环和触发器Tigger的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 短视频剪辑自学小技巧,掌握并运用,让你的
- 下一篇: 你为何会有中年危机感?”40岁失业”是一