Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The exception propagation goes from the internal-to-external block, as opposed to variable scope which goes from external-to-internal block. For more reference on this, read McLaughlin's "Programming with PL/SQL", Chapter 5.</p> <p>What you are getting here is an exception stack - exceptions raised from the innermost blocks to the outermost blocks.</p> <p>When you raise an exception from a trigger, your <code>raise_application_error</code> statement returns an error.</p> <p>It is then propagated to the trigger block which says <code>ORA-06512: at "C3283535.TRG_ORDER_LIMIT", line 12</code>. This is because the trigger treats the raised exception as an error and stops to continue.</p> <p>The error is then propagated to the session which raises the <code>ORA-04088: error during execution of trigger 'C3283535.TRG_ORDER_LIMIT'</code>. This error reports to us about where, as in which part of the program, the error was raised.</p> <p>If you are using a front-end program like Java Server Pages or PHP, you will catch the raised error - 20000 first. So, you can display the same to your end user.</p> <p><strong>EDIT :</strong></p> <p>About the first error - <code>ORA-20000</code>, you can change it in the <code>RAISE_APPLICATION_ERROR</code> statement itself.</p> <p>If you want to handle the <code>ORA-06512</code>, you can use Uday Shankar's answer which is helpful in taking care of this error and showing an appropriate error message.</p> <p>But, you will still be getting the last <code>ORA-04088</code>. If I was at your place I wouldn't have worried, as after getting the <code>ORA-20000</code> I would raise an application error at the front end itself while hiding all the other details from the user.</p> <p>In fact, this <em>is</em> the nature of Oracle's exception stack. All the errors from the innermost to the outermost block are raised. This is helpful a lot of times for us to identify the exact source of error.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload