我有一个psql脚本,如下所示:
-- first set of statements begin sql statement; sql statement; sql statement; exception when others then rollback write some output (here I want to exit the entire script and not continue on to the next set of statements) end / -- another set of statements begin sql statement; sql statement; sql statement; exception when others then rollback write some output (here I want to exit the entire script and not continue) end / ... and so on
是否可以退出脚本并停止处理脚本的其余部分?
将以下行放在文件的顶部:
WHENEVER OSERROR EXIT ROLLBACK WHENEVER SQLERROR EXIT ROLLBACK
……并确保你有一个升起;在异常处理程序的末尾.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。