Re: [Help]: PL/SQL Block "Handling NO_DATA

From: Colin Fraser <cfraser_at_korma.chilli>
Date: 26 Jul 1994 06:55:01 GMT
Message-ID: <312c05$dd4_at_pheidippides.axion.bt.co.uk>


In article 61H_at_shellgate.shell.com, ep40dcru_at_noh71af.uni-paderborn.de (David C. Richoux) writes:

>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.
>>>

MUCH CUT HERE A simpler way, surely, is simply to put the SELECT in it's own block with it's own exception handling thus:

BEGIN

	....
	fetch ...
	...
	BEGIN
		SELECT ...
		...
	EXCEPTION
	when NO_DATA_FOUND then
		INSERT ...
		...
	when OTHERS
	END;
	...
	...

END; Colin

I speak for myself! (This is just as well as everyone else disclaims any responsibility for my maunderings). Received on Tue Jul 26 1994 - 08:55:01 CEST

Original text of this message