Re: NO_DATA_FOUND EXCEPTION

From: Don Vick <dvick_at_lanier.com>
Date: 1995/04/24
Message-ID: <D7JMpG.MGD_at_lanier.com>#1/1


In article <3nbutc$4sp_at_news.annex.com>, <sanctus2_at_annex.com> wrote:
>In PL/SQL, if I do a SELECT INTO or a FETCH that returns 0 records, the
>NO_DATA_FOUND EXCEPTION is raised. That's all well and good but what do
>I do with it? If I write code to only do something if I RETRIEVE
>records, why can't I ignore the NO_DATA_FOUND? It ends up generating an
>error in my trigger and rolls back my transaction.
>
>I want to be able to retrieve no records WITHOUT erroring out my trigger.
>

One approach would be to encapsulate the retrieval in a procedure. Handle the exception in the procedure and pass a status code back to the trigger, or return a null value to indicate NO DATA FOUND.



Donald E. Vick (dvick_at_lanier.com, dvick_at_crl.com) Voice: (404) 493-2194 Fax: (404) 493-2399 Received on Mon Apr 24 1995 - 00:00:00 CEST

Original text of this message