declare
v_count number(8,3);
v_sal scott.emp.sal%type := '&P_sal';
cursor cur_name is select sal from scott.emp where sal
between (v_sal-100) and (v_sal +1000);
begin
v_count :=nvl(sql%rowcount ,0);
if v_count = 0 then
dbms_output.put_line('no records are fetch in the given sal
range');
else
dbms_output.put_line('There is/are '||to_char(v_count)||
' salaries are selected in the given range ');
end if;
end;

in the above programm .....for any sal range ....always it
shows the following message..

no records are fetch in the given sal range

please find the mistake and share with me...with thansk and
regards..sarao....

Answer Posted / sai

First open the cursor and fetch the records then u get the
required output.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to shut down the server with 'mysqladmin'? : Sql dba

733


What is the purpose of design view?

727


What is sap sql anywhere?

678


What is the use of function in sql?

728


What is string data type in sql?

724






What is not equal in sql?

695


What is procedure function?

706


What is crud stand for?

744


What are different types of sql?

755


How can we debug in PL/SQL?

853


What are all the ddl commands?

854


What is a primary key called that is made up of more than one field?

1026


what is the different between now() and current_date()? : Sql dba

701


What is scalar function in sql?

706


What is the difference between a procedure and a function?

697