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!

Raise Application Error

709156May 14 2012 — edited May 14 2012
Hello,

I have the following code where I am specifying raise_application error when condition is true so that exception will raise in my java code with matching error_code
20122. But I have noticed that error is getting logged in my db_table which I have specified in EXCEPTION WHEN OTHERS
THEN.

I would like to know why there is no exception is getting raised in java class with error code 20122

PLSQL Code.
BEGIN

 IF (value > 0)
    THEN
        raise_application_error (-20122, 'DB Commit Not Allowed');
    END IF;

___

EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
        NULL;
    WHEN OTHERS
    THEN
         insert into db_errors values(DBMS_UTILITY.format_error_backtrace,SQLERRM);
Thanks
This post has been answered by indra budiantho on May 14 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2012
Added on May 14 2012
13 comments
407 views