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

From: Scott Urman <surman_at_wwsun10.us.oracle.com>
Date: 18 Jul 1994 16:40:18 GMT
Message-ID: <30eb9i$fek_at_dcsun4.us.oracle.com>


What you need to do here is put your select statement in a sub block:

In article <1994Jul18.145244.26558_at_KYnug.org>, Neil Greene <neil_at_kynug.org> writes:

[yada yada yada]

|>
|> <<find_applicant>>

         begin

|> SELECT
|> nasrisid -- Primary unique key
|> INTO
|> myNASRISID -- May raise NO_DATA_FOUND error.
|> FROM
|> master source
|> WHERE
|> source.ss = c1_rec.ss AND
|> source.lname = c1_rec.lname AND
|> source.birthdate = c1_rec.birthdate;
exception when no_data_found then
|> <<insert_license>>
|> [ Block Deleted ]
myNASRISID := NULL; end;
|>
|> IF myNASRISID IS NULL THEN
|>
|> <<create_applicant>>
|> [ Block Deleted ]
|> commit;
|> -- Commit our insert so the
|> -- applicant will be found
|> -- if another submission is
|> -- for this applicant.
|> <<insert_master_license>>
|> [ Block Deleted ]
|>
|>

By putting the select statement into it's own block, you can handle the NO_DATA_FOUND exception in that block, and then continue processing in the main block. Received on Mon Jul 18 1994 - 18:40:18 CEST

Original text of this message