aspose file tools*
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
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.. .
 
 
subject: Raise an Exception from One StoredProcedure to another