You can throw user-defined error messages from PL/SQL code. Error codes between -20000 until -20999 are reserved for user specified error messages. You do so by calling the raise_application_error function within your PL/SQL:
raise_application_error(-20001, ‘Your error code message here’);
This will be propagated just like normal Oracle errors.

sumber : http://stackoverflow.com/questions/1544035/throwing-specific-error-messages-in-plsql-oracle-catching-in-hibernate

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.