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
What is an exception in PL/SQL? What are the two types of exceptions?
what is meant by nl2br()? : Sql dba
What are the packages in pl sql?
What is the difference between subquery and correlated query?
can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba
Explain how to use transactions efficiently : transact sql
Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)
Explain autonomous transaction.
What are the different dml commands in sql?
What is crud stand for?
What is lexical units in pl sql?
How can I get the number of records affected by a stored procedure?
Is primary key always clustered index?
How do you delete data from a table?
What does inner join mean?