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

Home -> Community -> Usenet -> c.d.o.server -> Re: null select

Re: null select

From: Lando <MarkL_at_quebim.com>
Date: 1997/08/28
Message-ID: <34060503.A1259DA6@quebim.com>#1/1

Oracle is complaining because you have an unhandled exeception. Try adding a no_data_found exception. This will let you decide how to handle a query that returns no data. If you are just trying to see if something exists in a table and don't want to use it in your program, use:

select count(*)
into myvar
from TableA
where ...

If myvar > 0
  then
    it exists
  else
    it does not exists.

M.Landa

Mr. News wrote:

> hi
>
> i am having some problems with my select into
> statement.
>
> i'm trying to see if an item is in a table. but
> oracle complains when nothing returns from
> the query.
>
> is there a way around this? i.e. how do i tell
> if something is in the table or not?
>
> here's a bit of code:
>
> select rpt_id
> into myvar
> from tableA
> where ...blah..
>
> thanks.
Received on Thu Aug 28 1997 - 00:00:00 CDT

Original text of this message

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