How can i get the error message from the thrown/raised exception?

DB version:10gR2
Examples for this thread taken from
Want Stored Procs to get exectuted regardless of preceeding SPs Success or
I have a package with several functions and procedures inside.I created a caller procedure called callProcs, which will execute various procedures within the package in the appropriate order.
In the below example i cannot get the error message thrown from line 20
create or replace package body mypackage
is
variable_proc1 number;
variable_proc2 number;
variable_proc3 number;
v_result       number;
my_exception   exception;
procedure proc1
is
begin
select 8/0 into variable_proc1 from dual;
exception
          when others
          then raise my_exception; ----line 20
end;
procedure proc2
is
begin
select 1 into variable_proc2 from dual;
exception
          when others
          then
               null;
end;
procedure proc3
is
begin
select 3 into variable_proc3 from dual;
exception
          when others
          then
               null;
end;
Procedure caller_proc
is
begin
proc1;
proc2;
proc3;
v_result:=variable_proc2+variable_proc3;
dbms_output.put_line('The output is '||v_result);
exception
          when my_exception
          then
dbms_output.put_line('Heyyyyy the error is '||SQLERRM); -- exception caught at line 64 of caller proc
end;
end mypackage;
When i try executing the caller proc, i don't get the error. Instead i get the text User-Defined Exception as shown below
set serveroutput on
exec mypackage.caller_proc;
Heyyyyy the error is User-Defined Exception
PL/SQL procedure successfully completed.Edited by: user10633418 on Mar 10, 2009 11:30 PM

Thank you justin.
Sorry my earlier post was a bit ambiguous.
I wanted the error generated at proc1 to be captured at caller proc's Exception handling section (line 64) so that i could log the error to an ERR_LOG table.
I can actually log this error at proc1 itself like
exception
when others
THEN
error_message :='My custom message for the particular proc '||SQLERRM;
dbms_output.put_line(error_message);
logerror(error_message); --an autonomous error logging proc
raise;But there is a RAISE statement in proc1's exception handling, so the exception gets propogated to caller proc's exception handling section {color:#ff0000}*and another redundant row will be created at ERR_LOG table for the same error because there is a*{color}
logerror(error_message);--an autonomous error logging proc
in the WHEN OTHERS section of exception handling section of the caller proc
I want to avoid the creation of this redundant row in ERR_LOG table.

Similar Messages

  • How can we get a alert message in  the current browser we are using the mom

    how can we get a alert message in the current browser we are using the moment we have entered some data in
    the table...
    I need a popup alert the moment a new record is added in a table... in apex database is 11g xe..
    The idea is I am using a apex application. .The moment new data is added in the table ..I am alerted by a message window..that a new record has been added...
    Thanks
    Edited by: pauljohny on Jun 11, 2012 10:23 AM

    pauljohny wrote:
    how can we get a alert message in the current browser we are using the moment we have entered some data in the table...
    "Current browser"? When viewing anything, or just when using an APEX app?
    Ans .. Just when using apex app....even if the apex app is minimised ..The current browser will be the one where I am using apex app...
    What i am looking for some scheduler .. to check ..in the table every 5 minute for change if there is a change..then a popup alert be shown...
    Split it into [at least] 2 components, database and browser. I'd expect someone calling themself a "DBA Architect" to have some ideas about the database side of things, even if not clued up on JavaScript and AJAX?
    I dont think its a database isssue... When i say to check every 5 minutes ..it could be easily done via dbms_scheduler ...I am having issue in getting the popup alert message...
    in apex... Dont know wether there is a plugin like modal window(available from skill builder) which shall help in this scenario,.Or might be have to use java scripting and ajax ..
    and if it is that (Java scripting and Ajax) .....then shall have to be familiar with java scripting and Ajax...and this shall be a bit time consuming..
    Had a feeling this could be accomplished via java scripting and ajax.. ...but still looking for some easy way..

  • How can i dispaly an Error Message from Server Side To form

    Hi All,
    How can i dispaly an Error Message from Server Side To form side .
    i try several ways nothing succed.
    i put the error in stack and after call the procedure from form i added
    Qms$Trans_Errors.Display_Messages;
    and because it is an error not informantional error the error screen displayed and enter
    in infinite loop acts like flashing .
    can any one help me please i use C/S Headstart6i and Designer 6i
    thanks alot
    radi

    hi,
    thanks alot lauri.
    yr code work only using information message but in error message its still the same .
    the error window still flash and enter in infinite loop of executeing the same triggers.
    thanks again
    radi

  • How can i get HD video out from the lumia 900. ? ...

    How can i get HD video out from the lumia 900. ? Is there some kind of gable. ? N8 has HD cable port..so where is lumia`s port. ?

    Download Zune and start it, when started connect your Lumia 900 and you can now transfer mediafiles from the Lumia to your PC through a USB connection. For Mac use the Mac connector.
    Press the 'Accept As Solution' icon if I have solved your problem, click on the Star Icon below if my advice has helped you!

  • I am running Windows 7 64Bit system and everything was working normal.  However, I am now getting an error message stating objc.dll is missing.  I've re-installed Itunes but to no avail.  How can I get this error message corrected?

    I am running Windows 7 64Bit system and everything was working normal.  However, I am now getting an error message stating objc.dll is missing.  I've re-installed Itunes but to no avail.  How can I get this error message corrected?

    See this User Tip by turingtest2
      https://discussions.apple.com/docs/DOC-6562

  • How can I disable RPS error messages in the AS5300 ?

    How can I disable de error message:
    " %RPS-3-MULTFAIL: There is more than one failure with the Redundant Power System; please resolve problems immediately "
    in the AS5300 with RPS Chassis and normal single power supply ?

    If you only have a single power supply,
    I would try swapping it (or swapping
    slots) to verify if it is the problem.

  • If messages are deleted from an itouch that is synced the same Apple ID and phone number, how can you get them to delete from the phone as well?

    how do I delete messages from both my itouch and my iphone

    You have to delete the messages from the individual device. If you delete messages on one device, messages on the other are not automatically deleted.

  • Using Quicken to manage a bank account, I get an error message from the bank that cookies and javascript must be enabled, but I don't get that message when I connect with Internet Explorer.

    Firefox allows me to get the bank home page through Quicken. But when I try to login, the error message appears saying "cookies and javascript" must be enabled. I have Java on my system, but in Firefox under "tools/options/ I don't find any way to "enable" javascript. I have enabled "cookies".
    I have no problem logging in at the bank site using Internet Explorer, but to use it, I have to designate it as the "default browser" before connecting through Quicken. I'd rather keep Firefox as the default.
    A bank tech representative was unable to find any commands in Firefox that would deal with this problem, although she clearly had manuals for both Internet Explorer and Firefox. So she concluded that I would have to use Explorer for this operation, since it allowed control of security level settings. She said that in Explorer, security level should be set to medium.
    Is there some similar control in Firefox?

    Firefox uses the same "security level" setting that is set in IE.
    Tools > Options > '''Content''' <br />
    Is '''Enable Javascript''' check-marked?
    http://kb.mozillazine.org/JavaScript_is_not_Java
    If that doesn't solve your problem, do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • HT204411 How can I get a tv show from the Canadian iTunes store from the United States Store?

    I have been trying to find the tv show the Listener and a few others everywhere. I can only find them in the Canadian iTunes Store. How can I get it in the United States Store?

    Ask whomever makes the show to sell it in the U.S Store.

  • How can I get around error message? "No installation on non-HFS disk:

    I am trying to install CS2 on my new Mac. How do I get around the following error message? "Installation onto non-HFS disk is not supported.

    Which new Mac?
    Is the hard drive PCIe-based flash storage? If so, you will probably need a newer version of AI.

  • HT201269 All the photographs stored on my computer ended up getting put on my iPhone. How can I get rid of them from the iPhone?

    All the photographs stored on my computer ended up getting put on my iPhone. How can I remove them from the iPhone?

    Photos synced to your phone can only be removed from your phone the same way they got there, through the iTunes sync process. Connect your phone, iTunes running, & under the photos tab remove the checks for all albums/folders you do not want on your phone. Hit the apply/sync button & they will be removed from your phone.

  • How can I get localized Error messages for basic errors ?

    I'm running JDK 1.6
    and I wrote :
    Locale.setDefault(Locale.CANADA_FRENCH);
                    try
                    java.io.File f = new java.io.File("c:/temp/xxnonexistentx");
                    byte aa[] = new byte[2];
                    java.io.FileInputStream fis = new java.io.FileInputStream(f);
                    fis.read(aa);
                    fis.close();
                    catch (Exception e)
                        System.err.println(" Err " + e.getLocalizedMessage());
            }And I get
    Err c:\temp\xxx (The system cannot find the file specified)why do I always get the US English error message. This is really a basic error, why does it seem that there is no localized version in French ?
    I also tried with
            Locale.setDefault(Locale.GERMAN);But I always get English �ber Alles !
    WHY ?

    As a developper I prefer my error messages in my
    langage. .NET does it (if I want), I like it. Do you
    know that O'Reilly & Flanagan Java reference book
    (1500 pages) in French sells very well in France ?
    Not so much the English version.As I said, I sympathize to some extent. With this part, yes.
    End-users do see some error messages (this file not
    found is an example), you want, me and all other
    people, to translate this type of messages in how
    many languages, each separately, over and over ?If I'm an end-user I don't want to see Java error messages. Or if I must, I only want to see them in the context of "This error message occurred, please pass it on to the technical support people when you call them". So, given that, I don't care if the system only produces German messages. This part I don't sympathize with.

  • How can i get a particular model from the iphone 5s

    I am from austria an for the lte i need the iphone 5s model A1457 or A1530. If i would buy one, would i get one of the model?
    Thanks for answering. ;)
    ...and sorry for my english

    If you live in Austria you cannot purchase from an online Store in another country
    The various models are only available in the countries shown on table I linked for you
    You could purchase in Germany and you will get the same warranty cover in Austria since both are member states of EU

  • I need to set up a new iTunes account. How can I get all my music from the old account on to the new one??? Thanks../

    I have just bought an ipad 2 and wish to set up a new account as now I won't have to share with my sister. I want to get all the music off my current iTunes account &amp; put it on to the ipad/new iTunes account. I'm not too sure how to do this though.... Please help lol :-) x

    If you mean iTunes libraries or computer user accounts, just create one. To make a new iTunes library on Windows, launch iTunes with the Shift key held down and choose Create Library.
    If you mean iTunes Store accounts, click here and request assistance.
    (79934)

  • How can I get back my bookmarks from the old sync?

    I reinstalled Firefox 29.0 but when I try to download the old sync bookmarks I can't find a way to enter my sync key.

    See this KB article - [[How to update to the new Firefox Sync]]

Maybe you are looking for

  • BOXI3.1: Error during migration -The system cannot find the path specified

    Hi, I'm trying to migrate my reporting server from BOXIR2 to BOXI3.1. I have a Java App which uses the SDK to generate reports hosted on BOE. I have updated the SDK and when i attempt to generate a very simple test report, i get this error: The syste

  • Levels in boiee 11g

    Hi, I need to clear one concept of obiee, in which i m very much confuse. let i have *"Budget Amount"* in fact table- ABC. how can we divide that amount month wise and quarter wise. I know we can do this by level based measures but plz explain me bri

  • Web designing in Photoshop

    I want to know how to design a blogger.com template using photoshop for my technology news blog ?

  • How to not only use real BAPI functions?

    Hi, I'm trying to get the value of leave entitlement of an employee. Browsing through the BAPI explorer I found the BAPI_TIMEQUOTA_GETDETAILEDLIST, but this only works for infotype 2006 and I need infotype 0005. Now I searched with transaction SE37 a

  • Closing Date showing 31-12-9999 instead of Actual Date

    Hi All, In the IC while creating Service request transaction in CRM 7.0 closing date is showing as per date rule in the Transaction but when we search the same transaction in the inbox the Closing Date showing as 31-12-9999. We have used standard Dat