DB2异常处理 [英] DB2 Exception handling

查看:154
本文介绍了DB2异常处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所面临的问题主要是异常处理!当发生异常时,我想将该数据放在另一个日志表中并显示错误消息。但是,在DB2中,我无法找出一种方法来检索提出的SQLSTATE的相应错误消息。



PS:我有一个存储过程用于此迁移,我没有使用任何其他语言来调用它。



<我们可以通过oracle中的SQLERRM来实现;可能这应该是一件小事,还有一些奇怪的原因我还没有找到它!



希望你对此有一个想法;-)。我只需要一个指针。



谢谢,



Harveer Uppal

解决方案

您应该可以使用 DB2Exception.Message 属性。


The problem that I am facing is primarily on Exception Handling! When an exception occurs I want to put that data in another log table with the error message. However, in DB2 I am not able to figure out a way to retrieve the corresponding error message for the raised SQLSTATE.

PS: I have a stored procedure for this migration and I am not using any other language to call it.

We could do this through SQLERRM in oracle; probably it should be a small thing, still for some strange reasons I have not been able to find it yet!

Hopefully you would have an idea on this, ;-). I just need a pointer on this.

Thanks,

Harveer Uppal

解决方案

You should be able to get in the front-end code using DB2Exception.Message property.

这篇关于DB2异常处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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