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
In a distributed database system, can we execute two queries simultaneously?
is mysql query is case sensitive? : Sql dba
How do I trace sql profiler?
What is tuple in sql?
Can we insert in sql function?
What is secondary key?
How to pronounce postgresql?
What are all the different types of indexes?
Show code of a cursor for loop.
What is the difference between explicit and implicit cursors in oracle?
What is sequence in sql?
What is sql*loader and what is it used for?
what is a composite primary key ? : Sql dba
What is attribute indicator in pl sql?
Can unique keys be null?