473,387 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Trapping system exceptions

11
Hello,
I see that Oracle raises its own exceptions for things like this:

EXECUTE IMMEDIATE l_sql_stmt INTO l_temp_string;

when there is no data found from the query. I don't want to handle all these exceptions in one WHEN DATA_NOT_FOUND exception handler. I think it is incredible that these exceptions can not be differentiated! In Java, such errors can be captured inside a try/catch block. But not here, it seems....

I can do some nasty kludge, like setting a global variable to tell me which function I was in when the error occurred, but does anyone else have an idea?

Thanks,
Kris
Mar 14 '08 #1
3 1522
kalyson
11
Well, I think I see the answer myself. You can use enclosing local blocks and have a no_data_found exception handler there that raises another exception that throws it to the main block's exception handler.
Mar 14 '08 #2
debasisdas
8,127 Expert 4TB
Yes you need to handle those in local blocks because the execution of exception is from inner block to outer block.
Mar 17 '08 #3
amitpatel66
2,367 Expert 2GB
Hello,
I see that Oracle raises its own exceptions for things like this:

EXECUTE IMMEDIATE l_sql_stmt INTO l_temp_string;

when there is no data found from the query. I don't want to handle all these exceptions in one WHEN DATA_NOT_FOUND exception handler. I think it is incredible that these exceptions can not be differentiated! In Java, such errors can be captured inside a try/catch block. But not here, it seems....

I can do some nasty kludge, like setting a global variable to tell me which function I was in when the error occurred, but does anyone else have an idea?

Thanks,
Kris
I do not understand what you mean by "I think it is incredible that these exceptions can not be differentiated??". You can differentiate the exceptions in oracle.
Mar 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: pythos | last post by:
I have a piece of code like this: try: some code except: print >> sys.stderr, "error: ", sys.exc_info() When an exception is thrown from the code, what I see on the console is this:
3
by: JWA | last post by:
Hi All, How can you capture unhandled exceptions thrown by an MDI child form separate from the entire app? I have an application-wide exception handler to catch crashes by doing the following...
13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
19
by: KKramsch | last post by:
One of the features from other languages that I miss most in C is trappable exceptions. More specifically, I think it's great to be able to demarcate a whole block of code where several exceptions...
9
by: 47computers | last post by:
Pretty new to PHP, I recently started learning about error trapping. As of right now, I include the following into a page in my website: -------BEGIN PASTE-------- error_reporting(E_ERROR |...
1
by: Elmo Watson | last post by:
Up until now, I've done all the work (gui/front end programming, classes, etc) I've done all my error trapping (try/catch) in the methods in the code behind. Now I've got an opportunity to do...
1
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of...
5
by: Yash | last post by:
Hi, I have create a user control which has a dropdown. The user control internaly handles the Selected_Index_Changed event of the dropdown. If there is an error/exception in handling it, I would...
3
by: John | last post by:
Hi I am updating a datatable in a dataset as below; daMyAdpater.Update(MyDataSet.MyTable) How can I trap various different exceptions that may occur during this update process? Thanks
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.