在oracle中检测函数时出错 [英] Error detecting function in oracle
本文介绍了在oracle中检测函数时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个需要案例的查询:
case当'a / b是错误'然后'10'否则'a / b'结束
如果出现错误我怎么能检测到?
谢谢.. !!
我的尝试:
nullif函数似乎不起作用,而且它创建了另一个级别的检查。
Hi All,
I have a query that needs a case when like:
case when 'a/b is error' then '10' else 'a/b' end
How can I detect that if there is an error?
Thanks..!!
What I have tried:
nullif function that does not seem to work and moreover it creates another level of checking.
推荐答案
b = 0时的情况或者a是null或b是null然后10 else a / b end
case when b = 0 or a is null or b is null then 10 else a / b end
这篇关于在oracle中检测函数时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文