Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sql%rowcount issue

913578Jan 15 2013 — edited Jan 15 2013
hi,

i am using oracle 11g2.0

declare

begin
select * from emp where sal>1000;

if sql%rowcount>1
then
dbms_output.put_line('There are few employees with sal>1000');
else
dbms_output.put_line('There are no employees with sal>1000');

end if;
end;

my question is will SQL%ROWCOUNT works for sql query? if there are 4 records in emp table with sal>1000 then the message 'There are few employees with sal>1000' will displayed?

please help me.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2013
Added on Jan 15 2013
6 comments
406 views