Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Problem
Create a user defined exception and then raise it when there are no rows and
supply your default value in the exception handler.
Mike Heisz wrote:
> I am trying to write a query to return 1 value.
> Sometimes there is no value and the query returns no data. i.e
> select a
> from b
> where
> ...... (here the conditions ensure that 1 or 0 rows are returned by the
> query)
>
> I need to supply a defeault value to be used when there are 0 rows returned.
> Is this possble and if so how do you do it?
>
> A couple of notes: This is part of a PL/SQL procedure but I can't use the
> NO_DATA_FOUND exception handler because I am dealing with files and this is
> used there.
>
> Thanks,
>
> Mike
Received on Thu Aug 12 1999 - 08:57:34 CDT
![]() |
![]() |