Question

I'd like to add an exception in my procedure when no argument is specified. Right now, I'm using

    when OTHERS then
      dbms_output.put_line('Error Occured');

But I'd like something that sounds like

    when NO_ARGUMENT then
      dbms_output.put_line('No argument specified');

I searched on the internet and couldn't find such an exception. The error code is 06550 when there is no argument. Is there a way to add an exception in that case?

Était-ce utile?

La solution

The ORA-06550 error is a generic PL/SQL compile error. The actual error you are trying to capture is PLS-00306: wrong number or types of arguments in call to XXXXXX.

This error occurs when the call is made and the parameters bind to the procedure. It is therefore something you cannot actually capture within the PL/SQL procedure itself since it occurs before entering your procedure.

Fully documented packages, procedures and functions with the detailed documentation of the PL/SQL "stubs" should reduce chances of this occurring and help to eradicate this kind of error.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top