Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Problem

Re: SQL Problem

From: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Thu, 12 Aug 1999 09:57:34 -0400
Message-ID: <37B2D2CE.44FCEBE3@Unforgettable.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US