我有这样的过程:获取实际的错误信息从甲骨文异常在斑点网
create or replace PROCEDURE MyProc
(
<some-parameters>
)
AS
BEGIN
if(<some-condition>) then
RAISE_APPLICATION_ERROR('my custom error message');
end if;
END;
当从C#调用它:
try
{
<call procedure>
}
catch(OracleException x)
{
lblMessage.Text = x.Message;
}
我收到错误信息,如:
ORA-28008: my custom error message ORA-06512: at blah, line blah ORA-06512: at line blah
我只想要:
my custom error message
没有innerException。错误收集不起作用。使用Exception而不是OracleException时的情况相同。
我错过了什么?
我可以使用字符串操作,但错误消息的格式有多固定?
是自定义错误消息ORA-XXXXX号每个错误消息都是唯一的? – Sathya 2012-04-28 17:21:56