Thursday, January 13, 2011

What happens when a PL/SQL process throws an exception in APEX

If your apex page has a PL/SQL process that throws an exception after page submit, the end result will depend the way you handle the exception.

Case 1: PL/SQL process doesn't raise an exception at all or you handle/catch the exception and doesn't raise it again.

Result: You will be forwarded to the page as per the branch created and the notification area will show the value assigned to the apex_application.g_print_success_message and "Process Success Message"

Case 2: PL/SQL process raised some exception.

Result: You will be forwarded to the apex error page. Here you can see the message in notification area if you had assigned some value to apex_application.g_print_success_message before the exception in process.

In addition to that the error page body will show the exception in below format.

ORA-20010: "Error text from Exception"
  Error : "Process Error Message"  
 OK 
Here the "Process Error Message" is the message you specified while creating the process.
e.g. : Process failed : #SQLERRM_TEXT#

In coming post, I will explain the way you can avoid redirecting to error page. This way you can show the exception on same page in a dialog box. This is good, isn't it...

No comments:

Post a Comment