Re: [Help]: PL/SQL Block "Handling NO_DATA_FOUND exception"

From: Yakir Lavie <yakir_at_tavult.enet.dec.com>
Date: 27 Jul 1994 09:55:31 GMT
Message-ID: <315auj$naj_at_decuk.uvo.dec.com>


In article <1994Jul18.145244.26558_at_KYnug.org>, Neil Greene <neil_at_kynug.org> writes: I have a pl/sql cursor that fetches records from a table. It then has a select statement that tries to find the submitted applicant in our current database. Of course, this select statement can FAIL with a NO_RECORDS_FOUND exception. I have an exception handler setup for this, but I would simply like the block to create the applicants master file and add the submitted data. But, I cannot figure out how to get back to my origional pl/sql block that called the exception since you CANNOT use a goto label from the exception handler back to the calling block.


Actually your solution should be quite simple, using a nested block: simply make a nested block containing your SELECT sttmnt AND the EXCEPTION HANDLER. This way the failure only applies to this one SELECT stmnt and you can do what you wanted, e.g.

        ...

	begin
		SELECT ...
	EXCEPTION
		When NO_DATA_FOUND ...
		<< create applicant >>
	end ;
	<<insert license>>


************************************************************************
Yakir Lavie

Software Consultant
Digital Equipment Corporation - Israel
(email: yakir.lavie_at_iso.mts.dec.com)
Received on Wed Jul 27 1994 - 11:55:31 CEST

Original text of this message