私はこの手順を持っています:
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 はありません。エラーの収集は役に立ちません。OracleException の代わりに Exception を使用すると、同じ状況になります。
私は何が欠けていますか?
文字列操作を使用できますが、エラー メッセージの形式はどのように固定されていますか?