Home » SQL & PL/SQL » SQL & PL/SQL » Exception handling
Exception handling [message #186584] Tue, 08 August 2006 10:45 Go to next message
bskiff
Messages: 27
Registered: May 2005
Junior Member
I know this is a simple question...but here goes.

I want to create a driver procedure that will call a bunch of other procedures. If one of the procedures fails and throws an exception, how can the driver procedure find this out?

Thanks!
Re: Exception handling [message #186591 is a reply to message #186584] Tue, 08 August 2006 12:01 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
If one of the "sub" procedures raises an exception, that will propagate to the "driver" procedure and you can decide how to handle it - stop the whole process, or move on to the next proc (you would need exception handling around each proc call to do this).
Re: Exception handling [message #186592 is a reply to message #186584] Tue, 08 August 2006 12:05 Go to previous messageGo to next message
scottwmackey
Messages: 505
Registered: March 2005
Senior Member
A vague question can only get a vague response. If the called procedure throws an exception, it can be trapped if you wrap each call in a BEGIN...EXCEPTION...END block. If you come up with something more specific, we can provide something more specific.
Re: Exception handling [message #186593 is a reply to message #186591] Tue, 08 August 2006 12:06 Go to previous messageGo to next message
scottwmackey
Messages: 505
Registered: March 2005
Senior Member
I'm too slow again.
Re: Exception handling [message #186605 is a reply to message #186584] Tue, 08 August 2006 13:00 Go to previous message
bskiff
Messages: 27
Registered: May 2005
Junior Member
Thanks for the replies. Sorry I didn't give more detail! I don't do alot to backend coding so I am still getting up to speed on some of this.

What I am trying to do is rewrite a big ugly procedure (the driver). It is basically 100+ calls to other procedures. However, there are a bunch of anonymous blocks and other misc queries thrown in. I want to make the anonymous blocks into procedures and then call them from the driver. The problem is, some of those blocks throw exceptions and stop executing the drivers code. When I move them to procedures, I seem to lose the exact error when it gets back to the driver. Does that make sense? The end goal is, once I get everything to run properly from the driver, to move all the procedure names to a table and loop through it, running each one. But I need to get the first step going before I can start on that.

Thanks again!

Previous Topic: Still not getting it ~ Please help
Next Topic: help needed
Goto Forum:
  


Current Time: Sat Dec 03 18:06:42 CST 2016

Total time taken to generate the page: 0.05169 seconds