Re: NO_DATA_FOUND EXCEPTION
Date: 1995/04/26
Message-ID: <D7MF3C.J3r_at_info.uucp>#1/1
In article <D7JMpG.MGD_at_lanier.com> dvick_at_lanier.com (Don Vick) writes:
>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.
>
Am I missing something or are you just looking to do....
begin
select ... into ... ...
exception
when no_data_found
NULL;
end; Received on Wed Apr 26 1995 - 00:00:00 CEST