Re: NO_DATA_FOUND EXCEPTION

From: Dave Boswell <bd860_at_FreeNet.Carleton.CA>
Date: 1995/04/25
Message-ID: <D7Ko21.p7_at_freenet.carleton.ca>#1/1


In a previous posting, (sanctus2_at_annex.com) writes:
> 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.
>
> I'd appreciate any help on this issue.
> Thanx....
>
> Jack Schwartz
> Systems Analyst
> Great Western Bank
>

If you want to get around the problem and reduce, in some case, system overhead,  use a cursor. This way you can check for the error, ignore duplicate records if you want, and have more control over system resources. In general if you are doing existance checks or filling display fields, a cursor is more effective then selects with exception handling.

Dave Boswell Received on Tue Apr 25 1995 - 00:00:00 CEST

Original text of this message