我是靠谱客的博主 称心小海豚,这篇文章主要介绍plsql oracle怎么回滚,PLSQL异常中的回滚,现在分享给大家,希望可以做个参考。

想知道在检测到SQL异常(其他人的异常)时是否需要回滚:

declare

cursor c_test is

select *

from tesing;

begin

for rec in c_test loop

begin

update test1 set test1.name=rec.name where test1.id=rec.id;

IF sql%rowcount = 1 THEN

commit;

ELSIF sql%rowcount =0 THEN

dbms_output.put_line('No Rows Updated');

else

dbms_output.put_line('More than 1 row exists');

rollback;

END IF;

exception when others then

dbms_output.put_line(Exception');

rollback;

end;

end;

最后

以上就是称心小海豚最近收集整理的关于plsql oracle怎么回滚,PLSQL异常中的回滚的全部内容,更多相关plsql内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(103)

评论列表共有 0 条评论

立即
投稿
返回
顶部