Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

RAISE_APPLICATION_ERROR

Rajan SwMar 4 2014 — edited Mar 4 2014

Hi Guys,

Can anyone tell me the values of keep_errors in RAISE_APPLICATION_ERROR like as per the documentation the syntax of the raise_application_error is RAISE_APPLICATION_ERROR(ERROR_NUMBER,ERROR_MESSAGE,KEEP_ERRORS) where the error no is the number between -20000 and -20999 and the error message is the user defined message and keep_errors is the boolean value if it is true then the error will be added to the error stack other wise it will purge the stack and add the recent error.

however when I am using this i am getting the following error,Please suggest if any body has any better solutions to use this

Declare

 

 

  begin

 

    If 200 > 100 Then

      Raise_Application_Error (-20001,'The if condtion is fine','TRUE');

    End If;

END ;

Below is the error I am getting

Error starting at line 1 in command:

Declare

 

 

  begin

 

    If 200 > 100 Then

      Raise_Application_Error (-20001,'The if condtion is fine','TRUE');

    End If;

END ;

Error report:

ORA-06550: line 7, column 7:

PLS-00306: wrong number or types of arguments in call to 'RAISE_APPLICATION_ERROR'

ORA-06550: line 7, column 7:

PL/SQL: Statement ignored

06550. 00000 -  "line %s, column %s:\n%s"

*Cause:    Usually a PL/SQL compilation error.

*Action:

Regards,

Ranjan

This post has been answered by Hoek on Mar 4 2014
Jump to Answer

Comments

843811
Such optimization are done by JIT compiler (not by javac).
C++ have just the same problems, exceptions make CFG analisis more difficult but not impossible.
PS You can read JLS about volatile variables there some additional restrictions on them.
843811
zhmur is right, this makes optimization harder not impossible.

There are sicentific papers aimed at making more analysis/optimization in the presence of many try/catch blocks. For instance, JIT can reorder statements, and then put compensation code into the catch body, recovering program state back if an exception was thrown.

General principle is simple: exceptions are rare. So JIT optimizes the "normal" control flow by the cost of more complex catch body.

You may also look/post to the comp.compilers newsgroup regarding compilers and optimization techniques

Denis

-----------------------------
www.excelsior-usa.com/jet.html
High-Performance JVM for J2SE
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 1 2014
Added on Mar 4 2014
12 comments
1,356 views