“当其他人为空"时有什么不好?在 PL/SQL 中? [英] What is bad in "When Others Then Null" in PL/SQL?

查看:20
本文介绍了“当其他人为空"时有什么不好?在 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天全站免登陆