Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Return value assigned to a number from an empty query.
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