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: Why the SQL%ISOPEN return false ???

Re: Why the SQL%ISOPEN return false ???

From: Mark Gumbs <mgumbs_at_nospam.hotmail.com>
Date: Tue, 8 Jun 1999 09:14:37 +0100
Message-ID: <375cce9d.0@145.227.194.253>


You probably have to rewrite using a cursor. Also safer since your implicit cursor could have raised no_data_found exception which you didn't handle.

declare

    v_result boolean;
    name varchar2(35);
    cursor c1 is

        select first_name into name
        from employee
        where first_name ='TEST';

begin

    open c1;
    fetch c1 into name
    if c1%FOUND then

        insert into testing values ('v_result is true');     else

        insert into testing values ('v_result is false');     end if;
    close c1;
    commit;
end;

HTH Mark

yew.poo.choon_at_mbf.com.my wrote in message <7ji8nu$bed$1_at_nnrp1.deja.com>...
>can anyone explain to me whay the follow PL/SQL block return me a
>FALSE value for variable v_result ?
>Thank you
>
>declare
>v_result boolean;
>name varchar2(35);
>begin
>select first_name into name
>from employee
>where first_name ='TEST';
>v_result := SQL%ISOPEN;
>if v_result then
> insert into testing values ('v_result is true');
>else
> insert into testing values ('v_result is false');
>end if;
>commit;
>end;
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Tue Jun 08 1999 - 03:14:37 CDT

Original text of this message

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