During the development process, you may often encounter some tests. At this time, you may want to understand the testing process and analyze the code Errors Based on the process. In this case, you need to use custom exceptions. For more information, see this article.
During the development process, you may often encounter some tests. At this time, you may want to understand the testing process and analyze the code Errors Based on the process. In this case, you need to use custom exceptions. For more information, see this article.
During the development process, you may often encounter some tests. At this time, you may want to understand the testing process and analyze the code Errors Based on the process. In this case, you need to use custom exceptions. For more information, see this article.
Declare an exception first
Java code
Biz_exception exception;
And then throw it out.
SQL code
The Code is as follows:
P_RETCODE: = '-1 ';
P_retInfo: = 'generated salary + Social Security Bill. Please do not generate it again. ';
Raise biz_exception;
In this way, the stored procedure goes to the final capture exception.
SQL code
The Code is as follows:
Exception
WHEN biz_exception then
Null;
When others then
P_RETCODE: = SQLCODE;
P_retInfo: = SUBSTR (SQLERRM, 1, 1000 );
DBMS_OUTPUT.PUT_LINE ('error Code' | p_RETCODE | ':' | p_retInfo );
Rollback;