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 / debasis mohanty

First We Have To Open Cursor
Then We Use Any Loop For That.
(because number of rows selected if we use loop)
After that Condition.
So That We Get Appropriate Answer.
Thanks & Regards
Debasis
dmddebasismohanty183@gmail.com
08722140827

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In a distributed database system, can we execute two queries simultaneously?

571


is mysql query is case sensitive? : Sql dba

565


How do I trace sql profiler?

492


What is tuple in sql?

547


Can we insert in sql function?

551






What is secondary key?

510


How to pronounce postgresql?

584


What are all the different types of indexes?

625


Show code of a cursor for loop.

584


What is the difference between explicit and implicit cursors in oracle?

516


What is sequence in sql?

507


What is sql*loader and what is it used for?

580


what is a composite primary key ? : Sql dba

583


What is attribute indicator in pl sql?

526


Can unique keys be null?

487