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: Return value assigned to a number from an empty query.

Re: Return value assigned to a number from an empty query.

From: damorgan <dan.morgan_at_ci.seattle.wa.us>
Date: Mon, 04 Feb 2002 20:20:53 GMT
Message-ID: <3C5EED25.287F5BF5@ci.seattle.wa.us>


This is Oracle ... not SQL Server. NULL is NULL.

If you perform the following:

SELECT myfield
FROM mytable
WHERE 1 = 2; you will generate an error called NO_DATA_FOUND. You must trap this with an exception statement. For example:

BEGIN
   SELECT myfield
   FROM mytable
   WHERE 1 = 2;
EXCEPTION
   WHEN NO_DATA_FOUND THEN
      myfield := 'NA';
END; Daniel Morgan

Craig Lehn wrote:

> What is the return value assigned to say a number when I preform a query
> that returns nothing how do I use an equal if statemen?
> if number = then
> number := 0;
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> Check out our new Unlimited Server. No Download or Time Limits!
> -----== Over 80,000 Newsgroups - 19 Different Servers! ==-----
Received on Mon Feb 04 2002 - 14:20:53 CST

Original text of this message

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