This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Raise an Exception from One StoredProcedure to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Raise an Exception from One StoredProcedure to another" Watch "Raise an Exception from One StoredProcedure to another" New topic
Author

Raise an Exception from One StoredProcedure to another

Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Hi All,

Actually I am facing a problem in SP.

The One SP is as follows:



______________________________________

this was the calling unit which is calling another "callingSP". Now I have the "callingSP" which is throwing Exception: "NO_DETAIL_FOUND".

And when I receive this exception in "callingSP". I also write code e.g.



is this right or I should simply right



Or even in both cases when I return to main Calling Unit.. It's automatically entering in

block..


COuld anyone helps me to let me know how to pass one exception raised in one SP to another SP.

And one more thing is the macahinsm differs in case of Function .

If any further clarifications is required then please let me know..??

Early helps are appreciated..


The Best way to predict your future is to create it - Every great individual common man
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

are you sure your calling sp is raising NO_DETAIL_FOUND, just a suggestion try raising NO_RECORD_FOUND

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Originally posted by Shailesh Chandra:
are you sure your calling sp is raising NO_DETAIL_FOUND, just a suggestion try raising NO_RECORD_FOUND

Shailesh


I took another alternative, actually what I was doing , I was raising an Object of User Defined Exception but it was local to each SP. So even although one SP was throwing User defined Exception, but it has been caught in general exception block.

Now What I have did exactly, I define this user defined exception globally and thus the problem has been solved.

I think this was the biggest mistake commited by me..this year...

Well Anyways Thankx a lot Dear Shailesh Chandra.. .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Raise an Exception from One StoredProcedure to another
 
Similar Threads
Question regarding finally block (Devaka, Final Exam, Question 1)
problem in static block of a class
Questions on Thread and Exception
problem in configuring log4j in struts
Raise an Exception in PL/SQL but not got @ JAVA End