Re: sql%notfound and NO_DATA_FOUND exceptions.

From: Cisco <prsingh_at_cisco.com>
Date: 1996/11/26
Message-ID: <01bbdbf1$6e678560$bad044ab_at_prsingh-pc.cisco.com>#1/1


Hi
SQL%NOTFOUND and SQL%FOUND are not be used in PL/SQL. As such SQL%NOTFOUND is never true for processing. The only way is to declare a cursor to handle it. The union works for complete data so if any table is returning rows it will not have NO DATA FOUND

Pratap

Rashid Karimov <rashid_at_rk.wbs.com> wrote in article <574nhg$lld_at_nnrp3.farm.idt.net>...
> In the code like the following:
>
>
> begin
> select id into t_id from widgets
> where name = 'X';
> if sql%notfound then
> null;
> end if;
>
> exception
> when *****
> **********
> end;
>
> Does the sql%notfound stmt. I have guarantees
> that NO_DATA_FOUND exception will not get propagated into
> exception block when and if raises ?
> What if I have if sql%found instead of sql%notfound , which
> looks like this:
>
> if sql%found then
> code1;
> else
> code2;
> end if;
>
> Will the NO_DATA_FOUND exception lead to the execution
> of code2 or I'll get an (explicit) exception ?
>
>
> And the other question I had stands not changed:
>
>
> in the code like:
>
> select id from t1
> where cond1
> UNION
> select id from t1
> where cond2;
>
> if it happens that one of the tables doesn't have any
> rows satisfying cond1 or cond2 , would I get NO DATA FOUND ?
>
>
> E-mail copy of followup , if any , would be appreciated.
> --
> ------------------
>
> Beyond the horizon of the place we lived when we were
 young
> In the world of magnets and miracles
> Our thoughts strayed constantly and without boundary
> The ringing of the division bell had begun ...
> -=PF, The Division Bell=-
>
>
Received on Tue Nov 26 1996 - 00:00:00 CET

Original text of this message