Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: sql%found problem
HAI all,
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.
> Select count statement always returns a number whether there exists rows
in the table or not.
>
> If there are no rows the outcome is 1 row with count as 0.
> If there are some rows in the table output is 1 row with count of Number
of rows.
> As always there is a row returned SQl %found is always TRUE
> So as per ur logic, it will always go to YES part...
>
> Saji
>
> ---------------------------------------- Message
History ----------------------------------------
![]() |
![]() |