Re: Error Handling in Stored Procedures - Oracle 8.1.7

From: Bradley Crockett <bcrockett_at_altavista.net>
Date: Sat, 06 Oct 2001 22:06:58 GMT
Message-ID: <6gLv7.53628$L8.14890132_at_news2.rdc1.bc.home.com>


In article <52a6e521.0110050642.26fe2f12_at_posting.google.com>, mycomputer1_at_hotmail.com says...

>stored procedure it returns with appropriate data if data exists
>otherwise it returns an error N0_DATA_FOUND.

Trap the error in the EXCEPTION section of the procedure.

EXCEPTION
   WHEN NO_DATA_FOUND THEN
      ...your code to handle the error...;

As soon as your procedure encounters a NO_DATA_FOUND error, it will skip to the EXCEPTION section and run the code after the THEN. You can do whatever processing you want there, after which the procedure will exit and return control to whatever called it.

Hope that helps some. Received on Sun Oct 07 2001 - 00:06:58 CEST

Original text of this message