我有這樣的過程:獲取實際的錯誤信息從甲骨文異常在斑點網
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