Home » SQL & PL/SQL » SQL & PL/SQL » Question on error handling (10g)
Question on error handling [message #430273] Mon, 09 November 2009 21:03 Go to next message
ajitpal.s
Messages: 204
Registered: November 2006
Senior Member
Hi,

I have a main procedure, which calls sub-procedures. And within the sub-procedures, there are more calls to multiple db objects (functions / package).

Lets say, if i include only one "exception when others block" at the main procedure, will it be able to capture the errors which occured in the lowest level of any procedure call.
Re: Question on error handling [message #430274 is a reply to message #430273] Mon, 09 November 2009 21:13 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Lets say, if i include only one "exception when others block" at the main procedure,
>will it be able to capture the errors which occured in the lowest level of any procedure call.

What do your tests indicate is correct answer?

How will you determine any posted response is correct & true?
Re: Question on error handling [message #430275 is a reply to message #430274] Mon, 09 November 2009 21:22 Go to previous messageGo to next message
ajitpal.s
Messages: 204
Registered: November 2006
Senior Member
I have actually programmed it using my test case, and im able to capture the error message. It works fine, i would like to confirm if im on the right track
Re: Question on error handling [message #430277 is a reply to message #430275] Mon, 09 November 2009 21:58 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Quote:
will it be able to capture the errors which occured in the lowest level of any procedure call.


Yes.
But be cautious while using WHEN OTHERS THEN

regards,
Delna
Re: Question on error handling [message #430310 is a reply to message #430273] Tue, 10 November 2009 00:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Why do you want to use a "exception when others block"?

Regards
Michel
Re: Question on error handling [message #430319 is a reply to message #430310] Tue, 10 November 2009 01:09 Go to previous messageGo to next message
ajitpal.s
Messages: 204
Registered: November 2006
Senior Member
the reason i wish to use this block is to catch all type of errors which occured in any procedure call.
  EXCEPTION
    WHEN OTHERS THEN
      ....


could you elaborate your point about being cautious, is there any specific areas i need to be concerned of.
Re: Question on error handling [message #430332 is a reply to message #430319] Tue, 10 November 2009 02:21 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
the reason i wish to use this block is to catch all type of errors which occured in any procedure call.

Why do you want to catch all errors? What do you want to make with them?

Regards
Michel
Re: Question on error handling [message #430336 is a reply to message #430319] Tue, 10 November 2009 02:31 Go to previous message
ayush_anand
Messages: 417
Registered: November 2008
Senior Member
yes a golden rule is donot catch an exception if you wish to do nothing out of it.Otherwise it will take years figuring out what is going wrong?
Previous Topic: Trigger for update on each row
Next Topic: Error while opening file(ORA-22288)
Goto Forum:
  


Current Time: Tue Feb 11 13:27:51 CST 2025