Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: sql%found problem
This is a multi-part message in MIME format.
------=_NextPart_000_00EE_01BFF0A6.98E38C30 Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
HAI PAUL, The problem not with SQL%found ,problem with count function.
If you use count function definitely it will return value Zero or more =
than zero.
It means SQL Stmt executed successfully and returning rows also,so It =
will never go to 'No' section in your coding .
By the way for your information
If you used Count funtion in SQL Stmt You no need to define Exception =
WHEN NO_DATA_FOUND since
the count function never return no rows;
Regards.
SUL.
hi all,
i had a problem over this query.could u tell me what is wrong in =
that query.
=3D=3D=3D=3D=3D=3D=3D=3D
declare
v number(10);
begin
select count(name) into v from str;
if sql%found then
dbms_output.put_line('yes '||v); else dbms_output.put_line('no '||v); end if; end;
=20
------=_NextPart_000_00EE_01BFF0A6.98E38C30 Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3Dtext/html;charset=3Diso-8859-1 =http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV> </DIV> <BLOCKQUOTE=20
dbms_output.put_line('yes '||v);<BR> =20 else<BR> dbms_output.put_line('no=20 '||v);<BR> end if;<BR> =
end;</DIV>
<DIV>it displays only "yes'' even though the table contins =
or not=20
contain any rows.</DIV>
<DIV>could u tellme what went wrong.</DIV>
<DIV>paul</DIV>
<DIV> </DIV>
<DIV><FONT color=3D#000000 face=3D""=20
=
size=3D3> &nbs= p;  = ; = =20 Received on Tue Jul 18 2000 - 01:54:50 CDT
![]() |
![]() |