Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: stupid newbbie question
Hello Kent,
maybe this helps you:
You have an SQL statement that may select nothing and this is ok for you. Try the following:
begin
Select xxx
from table
where any_condition;
exception:
when no_find then null;
when any_other_error then maybe you want to react?;
end;
continue with program...
I think this should help you. Please take a look at the syntag agin. I don't know it by heart.
Regards
Corinna Becker
Kent Eilers <kent.eilers_at_pca.state.mn.us> wrote in article
<366DA7F0.CF23009_at_pca.state.mn.us>...
> I writing some PL/SQL procedures and functions and have come up against
> a problem whenever a query returns no rows (ala the ORA-01403: no data
> found error message). I've looked in three books to get a strategy on
> dealing with this and have come up with zilch.
>
> Basically I do not want to go to an exception handler when this
> happens. I thought I had escaped this drainhole by first running a
> query to dump the count(*) into a local variable. But this still
> triggers the 1403 error.
>
> What do all you PL/SQL pro's do? My (rather limited) understanding of
> the exception handler is you cannot 'on error resume....' so how do deal
> with this?
>
> Any response greatly appreciated!
>
>
Received on Fri Dec 11 1998 - 09:27:12 CST
![]() |
![]() |