“当其他人倒空时"的坏处是什么?在PL/SQL中? [英] What is bad in "When Others Then Null" in PL/SQL?

查看:124
本文介绍了“当其他人倒空时"的坏处是什么?在PL/SQL中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚阅读了这个问题,一个解决方案指出:

I just read this question, and a solution states that:

您不知道自己得到的事实 NO_DATA_FOUND异常表明 你已经成为最大的人之一 PL/SQL开发人员曾经犯过的错误:

The fact that you don't know you got the NO_DATA_FOUND exception suggests that you have made one of the biggest errors PL/SQL developers ever make:

EXCEPTION
    -- Never do this in real code!!!
   WHEN OTHERS THEN NULL;
END;

您能解释一下此语句中的错误吗?为避免该错误,您会怎么做...

Could you explain me what is the error in this statement and what would you do to avoid doing that...

推荐答案

问题是,您正在捕获所有异常,然后将其忽略.您永远不会知道什么时候出了问题.

The problem is, that you are catching all exceptions, and then ignoring them. You'll never know when something went wrong.

这篇关于“当其他人倒空时"的坏处是什么?在PL/SQL中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆