How to Inscribe all the error messages into a single package ??

Hi,
I want to Inscribe all the error messages into a single package., and call the concern package from the exception block in every sp by passing the error code to that package, which will return the Concern error message to the calling Sp.,
Can any one help me out how to accomplish this ., ?
regards
Raja

I want to Inscribe all the error messages into a single package., Why do you want to inscribe all the messages in a package?
I would suggest you to store them in a table instead and you can write a functin to retrive the error messages required.
But if your requirement is for 'Package' then assuming that you store all the error messages in a table 'error_table' (say) following code may help you .
CREATE TABLE Error_Table (
  Error_Code VARCHAR2(10),
  Error_Desc VARCHAR2(1024));Now insert your error codes and descriptions in this table.
CREATE OR REPLACE PACKAGE pkg_Error_Handler
AS
  FUNCTION f_Get_Error_Message(p_Error_Code  Error_Table.Error_Code%TYPE) RETURN VARCHAR2;
END pkg_Error_Handler;/
CREATE OR REPLACE PACKAGE BODY pkg_Error_Handler
AS
  FUNCTION f_Get_Error_Message
       (p_Error_Code  Error_Table.Error_Code%TYPE)
  RETURN VARCHAR2
  IS
    lv_Error_msg  Error_Table.Error_desc%TYPE;
  BEGIN
    BEGIN
      SELECT Error_desc
      INTO   lv_Error_msg
      FROM   Error_Table
      WHERE  Error_Code = p_Error_Code;
    EXCEPTION
      WHEN No_Data_Found THEN
        lv_Error_msg := 'No such error code '
                        ||p_Error_Code
                        ||' defined in the system';
      WHEN OTHERS THEN
        lv_Error_msg := p_Error_Code;
    END;
    RETURN lv_Error_msg;
  END f_Get_Error_Message;
END pkg_Error_Handler;
/and you can call this packaged funtion from any exception block to get the error description.
Regards,
Abhijit.
N.B.: Code not tested

Similar Messages

  • OMB Plus : how to get all the generated messages into a text file ?

    Hello,
    I wrote an OMB TCL script and I would like to know how to get all the messages generated during the exécution into a text file.
    I tried this, but it works only for a puts command :
    set DesProjet ACT_1
    set filename [ open "c:\\temp\\INFDE_010_IMPORT_REPOSITORY_$DesProjet.log" w]
    puts "test"
    Thank you for your help

    Hello Alain, you should try the OMBLOG variable. If you set it inside OMBPlus:
    set OMBLOG c:/temp/mylog.txtthen all the OWB specific commands are logged with their output. By OWB specific I mean all those that start with OMB.
    This is more than what you see in the interface, because:
    - messages inside procedures are logged; you wouldn't see them on std.output when you call a proc
    - variables are resolved, so if you issue the command
    set my_var VERY_IMPORTANT_TABLE
    OMBDROP TABLE '$v_myvar'the log will show:
    OMBDROP TABLE 'VERY_IMPORTANT_TABLE'
    Table dropped
    and you know something is wrong... so OMBLOG is very useful to intercept all manipulations on you repository.
    If what you want instead is a dump of the screen output when you execute a script, I suggest you redirect standard output from the operating system command line. Unfortunately OMBPlus doesn't support all advanced redirection and tracing features of the TCL language.
    Hope this helps, Antonio

  • How to store all the columns values into one single column

    Hi All,
    this is my file layout,i am receiving the data in below format only
    emp_no,c1,c2,c3,c4,c5
    100 ,1 ,0 ,1 ,0,1
    200 ,1 ,0 ,1 ,0,1
    300 ,1 ,0 ,1 ,0,1
    but i want to store that above data into my table like(from c1 to c5 columns values i want to store in period column)
    emp_no,period
    100 ,1
    100 ,0
    100 ,1
    100 ,0
    100 ,1
    200 ,1
    200 ,0
    200 ,1
    200 ,0
    200 ,1
    300 ,1
    300 ,0
    300 ,1
    300 ,0
    300 ,1
    please help me

    Strange but this is it
    Processing ...
    with original as (
         select 100 as id ,1 as v1,0 as v2,1 as v3,0 as v4,1 as v5
         from dual
         union all
         select 200 ,1 ,0 ,1 ,0,1
         from dual
         union all
         select 300 ,1 ,0 ,1 ,0,1
         from dual
    select id,v1 as res_row
    from original
    union all
    select id,v2
    from original
    union all
         select id,v3
         from original
    union all
         select id,v4
         from original
    union all
         select id,v5
         from original
                      ID                                   RES_ROW
                                       100                                      1
                                       200                                      1
                                       300                                      1
                                       100                                      0
                                       200                                      0
                                       300                                      0
                                       100                                      1
                                       200                                      1
                                       300                                      1
                                       100                                      0
                                       200                                      0
                                       300                                      0
                                       100                                      1
                                       200                                      1
                                       300                                      1
    15 row(s) retrievedBye Alessandro

  • How can I put all output error message into a String Variable ??

    Dear Sir:
    I have following code, When I run it and I press overflow radio button, It outputs following message:
    Caught RuntimeException: java.lang.NullPointerException
    java.lang.NullPointerException
         at ExceptionHandling.ExceptTest.actionPerformed(ExceptTest.java:72)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:291)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:6038)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
         at java.awt.Component.processEvent(Component.java:5803)
         at java.awt.Container.processEvent(Container.java:2058)
         at java.awt.Component.dispatchEventImpl(Component.java:4410)
         at java.awt.Container.dispatchEventImpl(Container.java:2116)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
         at java.awt.Container.dispatchEventImpl(Container.java:2102)
         at java.awt.Window.dispatchEventImpl(Window.java:2429)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)Caught RuntimeException: java.lang.NullPointerException
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)I hope to catch all these error message into a String Variable such as StrErrorMsg, then I can use System.out.println(StrErrorMsg) to print it out or store somewhere, not only display at runtime,
    How can I do this??
    Thanks a lot,
    See code below.
    import java.awt.Frame;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.FileInputStream;
    import javax.swing.ButtonGroup;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JRadioButton;
    public class ExceptTest extends JFrame implements ActionListener {
        private double[] a;
      private JRadioButton divideByZeroButton;
      private JRadioButton badCastButton;
      private JRadioButton arrayBoundsButton;
      private JRadioButton nullPointerButton;
      private JRadioButton negSqrtButton;
      private JRadioButton overflowButton;
      private JRadioButton noSuchFileButton;
      private JRadioButton throwUnknownButton;
      public ExceptTest() {
        JPanel p = new JPanel();
        ButtonGroup g = new ButtonGroup();
        p.setLayout(new GridLayout(8, 1));
        divideByZeroButton = addRadioButton("Divide by zero", g, p);
        badCastButton = addRadioButton("Bad cast", g, p);
        arrayBoundsButton = addRadioButton("Array bounds", g, p);
        nullPointerButton = addRadioButton("Null pointer", g, p);
        negSqrtButton = addRadioButton("sqrt(-1)", g, p);
        overflowButton = addRadioButton("Overflow", g, p);
        noSuchFileButton = addRadioButton("No such file", g, p);
        throwUnknownButton = addRadioButton("Throw unknown", g, p);
        getContentPane().add(p);
      private JRadioButton addRadioButton(String s, ButtonGroup g, JPanel p) {
        JRadioButton button = new JRadioButton(s, false);
        button.addActionListener(this);
        g.add(button);
        p.add(button);
        return button;
      public void actionPerformed(ActionEvent evt) {
        try {
          Object source = evt.getSource();
          if (source == divideByZeroButton) {
            a[1] = a[1] / a[1] - a[1];
          } else if (source == badCastButton) {
            Frame f = (Frame) evt.getSource();
          } else if (source == arrayBoundsButton) {
            a[1] = a[10];
          } else if (source == nullPointerButton) {
            Frame f = null;
            f.setSize(200, 200);
          } else if (source == negSqrtButton) {
            a[1] = Math.sqrt(-1);
          } else if (source == overflowButton) {
            a[1] = 1000 * 1000 * 1000 * 1000;
            int n = (int) a[1];
          } else if (source == noSuchFileButton) {
            FileInputStream is = new FileInputStream("Java Source and Support");
          } else if (source == throwUnknownButton) {
            throw new UnknownError();
        } catch (RuntimeException e) {
          System.out.println("Caught RuntimeException: " + e);
          e.printStackTrace();
          System.out.println("Caught RuntimeException: " + e);
        } catch (Exception e) {
          System.out.println("Caught Exception: " + e);
      public static void main(String[] args) {
        JFrame frame = new ExceptTest();
        frame.setSize(150, 200);
        frame.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
        frame.show();
    }

    yes, I update as follows,
    but not looks good.
    import java.io.*;
    public class UncaughtLogger implements Thread.UncaughtExceptionHandler {
        private File file;
        private static String errorMessage;
        public UncaughtLogger(File file) {
            this.file = file;
            //Thread.setDefaultUncaughtExceptionHandler(this);
        public UncaughtLogger(String str) {
            this.errorMessage = str;
            Thread.setDefaultUncaughtExceptionHandler(this);
        //@Override()
        public void uncaughtException(Thread t, Throwable e){
            try {
                log(e);
            } catch (Throwable throwable) {
                System.err.println("error in logging:");
                throwable.printStackTrace();
        private void log(Throwable e) throws IOException {
            PrintWriter out = new PrintWriter(new FileWriter(file, true));
            try {
                e.printStackTrace(out);
            } finally {
                out.close();
        private static UncaughtLogger logger = new UncaughtLogger(new File("C:/temp/log.txt"));
        private static UncaughtLogger logger2 = new UncaughtLogger(errorMessage);
        public static void main(String[] args) {
                String s1 = "Hello World!";
                s1 = null;
                String s2 = s1.getClass().getName();
                System.out.println(s1);
                System.out.println(s2);
                System.out.println("errorMessage =" + errorMessage);
    }

  • Please help me how concatenate all the error messages and send it as out parameter value.

    Hi Experts,
    Please help me how concatenate all the error messages and send it as out parameter value.
    Thanks.

    Agree with Billy, exception handling is not something that is done by passing parameters around.
    PL/SQL, like other languages, provides a suitable exception handling mechanism which, if used properly, works completely fine.  Avoid misuing PL/SQL by trying to implement some other way of handling them.

  • How can we view the error message numbers in the web ui?

    Dear all,
    How can we view the error message numbers in the web ui? It gives the error but no number.  It is possible to debug in web UI so how can we accomplish this?
    Thanks,
    FK

    Hi  Fakhan,
    You can absolutely do that.
    Check the class: CL_BSP_MESSAGES
    Also if you want to find out the exact Message Class and Message Number, go to table T100, type text in field TEXT, you will get Message Class and Message number in fields ARBGB and MSGNR respectively.
    I hope this helps.
    THanks
    Vishal

  • How can i see the error message?

    hi, i have written a procedure in the database 10g, with my own error, and it works. but, when my exception occurs, i want to see my ora-20000-message in the footer of the isql-screen in the same way like normal ora-errors do it. because, now the code handles the exeption, but i can not se any message.
    thx.
    (zahl1 in number, zahl2 in number)
    as
    maxvertrag number;
    ergebnis number;
    myerror exception;
    pragma exception_init(myerror, -20000);
    begin
    select max(vertragsnr) into maxvertrag from robertl.tblugovor;
    ergebnis := zahl1+zahl2+maxvertrag;
    if ergebnis>104
    then
    RAISE_APPLICATION_ERROR (-20000, 'Result is > 104!');
    end if;
    exception when myerror then
    ergebnis:=0;
    end;

    This is answered in how can i se the error message?.
    As a side note, you generally don't need to cross-post in these two fora, as many of us frequent both.
    Cheers, APC

  • HT1386 Error message says only one library per device. My previous computer crashed and now I want to sync with new computer. How do I overcome the error message?

    Error message says only one library per device. My previous computer crashed and now I want to sync with new computer. How do I overcome the error message?

    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • How can I convert the volume directory into a single file installer?

    How can I convert the volume directory into a single file installer? I would like to hide all the miscillaneous files that I don't care for and be able to have the installer double click a single file and have it automatically install.

    On the second prompt screen when prompted 'What kind of self-extracting Zip file file do you want to make?'
    Are you choosing the second option (self-extracting Zip file for software installation)?
    I have a word file that I created to help me remember - is there anyway to email it to you?

  • How to group all the reports and execute like single application ?

    Hi,
    I am trying to develop some reports in Crystal Reports XIR2 , here i have Design and Preview options that is for every report i should see , how to group all the reports and execute like single application?
    any option is there to run the report
    i mean is it possible to have a home page from there have links to each report and when i click on the link corresponding report should be shown , if it is possible , How?
    Regards,
    kathyaini

    You will want to look into Crystal Reports Server, it does exactly what you describe and more:
    http://www.businessobjects.com/product/catalog/crystalreports_server/
    Download a trial of CR Server here:
    http://www.businessobjects.com/product/freetrials.asp

  • How to add the error message into Delivery Error Log (VL10A,VL10X)

    Hi,
    I have a to add my custom message into Delivery creation error log (VBFS, VBSS)
    This message should be shown in the Collective process log (VL10X, VL10A).
    Please give me the soln to solve this problem.
    I have searched in SDN, i didnt get the proper solution
    Thanks
    Shankar

    HI,
    Make use of the BADi "LE_SHP_DELIVERY_PROC"
    Use the method DELIVERY_FINAL_CHECK.
    Pass the error messages in table CT_FINCHDEL.
    Regards,
    Ankur Parab

  • How do I correct the error message "an error occured while downloading....dismiss"

    I recently started receiving the error message "an error occurred while downloading" on an intermittent basis when trying to download pictures in some of my Yahoo groups using Yahoo mail. When it occurs the only way to clear the error message is to click on a highlighted "dismiss" [a term I had never seen used before these error messages started] which shows after the error message.
    When the error shows for one pic in the posting it will show for all the pics in that post. When the error occurs for an individual pic it will also show up if you try to "download all".
    These errors will show up for a posting sent from the same sender via one email group while not for the exact same email sent to another group. It is not restricted to an individual who is posting or a specific Yahoo group and appears to be truly random.
    Recently I found an example of the same error message in a posting from a Yahoo group in my Gmail account as well so it is not restricted to Yahoo mail alone.
    Has anyone else encountered this problem?....Does anyone know how to fix it?

    Hi saxxy60, I have not encountered this error before, but I have when the internet connection is lost in the middle of the download. You can try to disable any antivirus on the computer [http://answers.microsoft.com/en-us/ie/forum/ie10-windows_8/an-error-occurred-while-downloading-attachment-in/02b00230-ed67-473c-9ad8-370deac2272e?msgId=0d3d89cf-2722-43f3-b21b-2f3214e2f1d1]
    You can try to get more elaborate errors if you try to reproduce the issue with an HTTP traffic capture.
    *An add on [https://addons.mozilla.org/en-us/firefox/addon/live-http-headers/ Live HTTP Headers]
    *[http://www.telerik.com/download/fiddler Fiddler]
    Please let us know if this helped you out!

  • 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.

  • PSE 8 - How do I fix the error message: An error has occurred reading files or writing to disk...?

    Hello
    I am using Photoshop Elements 8 on Windows 7 (64 bit). I have all my photos stored on an external hard drive connected by usb. The photos were transferred onto the HDD from a Windows XP machine. I bought a new computer  so I installed Photoshop 8 and imported all my photos to the organiser from the HDD. I have also taken some photos yesterday which I have uploaded to the HDD.
    Now, when I want to delete a photo I check the box to say I want it to be deleted on the hard disk and I get the error message: 'An error has occured while reading files or writing files to disc. The disc may be full or there may bea problem with the source media.' This does not happen with the photos I uploaded yesterday, only the ones which were put onto the HDD from the XP machine.
    Please could someone help? I have tried the File>Catalog> repair and optimise functions. I have reinstalled the software. It still does the same.
    Thank you in advance
    Dave

    David GW wrote:
    The error message goes on to say, Please check your device settings or consult your device documentation regarding resolving writing errors. Which device do you think they are referring to?
    Sorry, but I would have thought that this was rather obvious! The only device capable of being written to under these circumstances is your CD drive; after all, it's a CD you are trying to create...
    You have two potential major causes of problems here. The most common cause of these difficulties is the disks themselves - you only need a batch with poor reflectivity to cause all sorts of read errors, so that's the first thing to try - using a different brand of disk to write to. The second thing you have to realise is that CD writers have a finite life - the lasers in them simply don't last for ever, and towards the end of their lives the power behaviour tends to be a bit erratic, and it tends to fall off somewhat - which causes the same sorts of errors, simply because the dye doesn't get evaporated efficiently. This causes mis-formed pits, hence the read errors. The only solution here is to install a new drive.
    When it comes to reading, commercial CDs have a much higher reflectivity than ones you write yourself, so often these will play whilst your own will fail - a common cause of confusion, this. But it's worth checking; if you get failures to reproduce all of the tracks from a commercial pressed CD, then almost certainly your drive is failing.

  • How do you fix the error message, An error has been encountered while writing the current CD list.

    The error message goes on to say, Please check your device settings or consult your device documentation regarding resolving writing errors. Which device do you think they are referring to? The message came up half way through writing Track 5. So I selected a second set of tracks and got the same error message, this time at Track 3. I tried to play written CD (imation CD-R 1x 52x 700 mb). Opened the tracks using Windows Media Player. First time I was able to play one or two tracks, next time Window Media Player gave me the error message error message C00D0FAB. I have twice before successfully recorded the tracks using a Rode Podcaster, mixed them down and successfully wrote two version of my audio book. Now its not working. Any solutions?

    David GW wrote:
    The error message goes on to say, Please check your device settings or consult your device documentation regarding resolving writing errors. Which device do you think they are referring to?
    Sorry, but I would have thought that this was rather obvious! The only device capable of being written to under these circumstances is your CD drive; after all, it's a CD you are trying to create...
    You have two potential major causes of problems here. The most common cause of these difficulties is the disks themselves - you only need a batch with poor reflectivity to cause all sorts of read errors, so that's the first thing to try - using a different brand of disk to write to. The second thing you have to realise is that CD writers have a finite life - the lasers in them simply don't last for ever, and towards the end of their lives the power behaviour tends to be a bit erratic, and it tends to fall off somewhat - which causes the same sorts of errors, simply because the dye doesn't get evaporated efficiently. This causes mis-formed pits, hence the read errors. The only solution here is to install a new drive.
    When it comes to reading, commercial CDs have a much higher reflectivity than ones you write yourself, so often these will play whilst your own will fail - a common cause of confusion, this. But it's worth checking; if you get failures to reproduce all of the tracks from a commercial pressed CD, then almost certainly your drive is failing.

Maybe you are looking for

  • Problems after upgrading to ios 6.1.2

    After upgrading to ios 6.1.2 my iphone4 no longer recognises the docking station - anyone else having this problem, how to i fix it?

  • Javax.servlet package

    hi i am using netbeans but i want to deploy some servlets in my mobile application but i am getting problem in accessing javax.servlet package. can anyone tell me where can i get this one. my application is stuck now ......plz reply me fast...... i s

  • No radio button in music

    I'm probably being stupid, but my recently installed ios7 has no 'radio'option in music. How do I get round this?

  • How to take a snapshot in Final Cut Pro X 10.0.6?

    Just updated and could't find the button like in the older version.

  • What email address do I send a screenshot of my problem to?

    My Mom uses the ION forum and when posting a reply a box is there to write in. There is a place to select a font which just says "font" but does not open with fonts like it does when using Internet Explorer. Also, there are "smileys" to the left whic