views:

94

answers:

1

In a stored procedure I have used to;

raise_application_error (-20010, 'My Message');

to raise a custom error in a certain situation. What I am trying to do is when I make my JDBC call from java, to be able to identify this error as not just being a SQLException so that I can handle it differently. I though I could identify it by the errorCode, but that seems to always be 17062 and not -20010.

Is there another way to do this, or am I missing something?

+2  A: 

Hi bigbrother,

you should get 20010 as your errorCode. the ORA-17062 is an error for invalid ref cursors. Are you sure the procedure you are calling throws the custom error ?

Vincent Malgrat
Wow I feel foolish. It was throwing the error, but I was also catching the exception in the package, logging it, and then returning null, causing the ORA-17062. Didn't think about it until I read your post. Thanks for the help.
jschoen
Glad to help =)
Vincent Malgrat