I am having a pl/sql procedure. I am handling exceptions in exception block. There are couple of logical errors which may occur during the process.
So, whenver there is a situation occurs other than oracle exceptions, I want to handle it programatically, and want to pass a reasonable message.
So, I am thinking whether we can create our own exceptions or not?
Is there anyway we can do this?
asked Dec 16, 2009 at 05:22 PM in Default
Error numbers in the range -20000..-20999 are reserved for the user-defined errors. You can easily raise your own error and catch it later as an exception:
--- This code will throw ORA-20010
raise_application_error(-20010, 'Operation failed');
answered Dec 16, 2009 at 05:36 PM