6 Replies Latest reply: Jan 31, 2013 1:57 PM by user346369 RSS

    how to display error?

    yash_08031983
      Hello experts,

      as by default ctl_shift+e is use to display error.
      i want to display " display error" on on-error trigger .
      is it possible.

      i generaly use on key-others trigger
      null; statement to avoid all the extra action associated with keys.
      which also restrict the use of ctl_shift_e fucntion.

      i want when i press ctl+shift+e display error will execute despite using null; on key-others trigger;

      thanks
      yash
        • 1. Re: how to display error?
          Amatu Allah Neveen Ebrahim
          Hi Yash

          Best approach i preferred is to create a table for storing the error number & the description of the error or informative message then create a procedure and call it in both
          on_error & on_message triggers form level
          hope this help

          Amatu Allah
          • 2. Re: how to display error?
            HamidHelal
            yash_08031983 wrote:
            Hello experts,

            as by default ctl_shift+e is use to display error.
            i want to display " display error" on on-error trigger .
            is it possible.

            i generaly use on key-others trigger
            null; statement to avoid all the extra action associated with keys.
            which also restrict the use of ctl_shift_e fucntion.

            i want when i press ctl+shift+e display error will execute despite using null; on key-others trigger;
            HI yash,
            Just catch the error code and write your message or system message at ON-ERROR trigger or can perform what Amatu says.

            Hope this helps
            • 3. Re: how to display error?
              yash_08031983
              thanks all,
              you explain the different approaches but i want that particular which i described.

              as you said catch the error code but some time procedure declare on form raised some error and in that procedure which sql statement raise the exception, its quite difficult to find. for this you have any trick.
              or
              can we find the which sql statement raise the error or exception in procedure having multiple pl/sql blocks or multiple sql statements ????????


              thanks
              yash
              • 4. Re: how to display error?
                HamidHelal
                yash_08031983 wrote:
                thanks all,
                you explain the different approaches but i want that particular which i described.

                as you said catch the error code but some time procedure declare on form raised some error and in that procedure which sql statement raise the exception, its quite difficult to find. for this you have any trick.
                Hi yash
                You can write custom code in procedure and also display to user. Like
                sql statement
                .........
                    EXCEPTION
                      WHEN NO_DATA_FOUND THEN
                        raise_application_error(-20000,'Failed to send mail due to Approve band data not found. ' || sqlerrm); --Band not set or higher authority.
                Hope it's help


                Hamid
                • 5. Re: how to display error?
                  Amatu Allah Neveen Ebrahim
                  Hi
                  pls try
                  EXCEPTION 
                  
                   When No_Data_Found THEN NULL;
                  
                  When Others THEN
                  Message ('OTHERS' || SQLCODE || ' And ' || SQLERRM);
                  Message ('OTHERS' || SQLCODE || ' And ' || SQLERRM); 
                  END;
                  You have to additionally check DBMS_ERROR_CODE for db-errors.
                  or

                  >RAISE FORM_TRIGGER_FAILURE;
                  if u need to stop user from continuing entering data

                  Amatu Allah
                  • 6. Re: how to display error?
                    user346369
                    You can display the contents of DBMS_ERROR_TEXT in your on-error trigger. For an example of what I use, see this (very old) topic:

                    <p><font color="#FFFFFF">_________</font>Re: Error Trapping
                    <p><font color="#FFFFFF">_________</font>FRM-40735:Pre_Insert trigger raised unhandled exception ORA-20011


                    <font color="#FFFFFF">keywords for searching later: pll_on_error error_code error_text</font>