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

Why do we use joins in sql?

499


How do I find duplicates in a single column in sql?

532


how do you control the max size of a heap table? : Sql dba

534


Which sql statement is used to return only different values?

500


What are the benefits of stored procedures?

530






What is procedure explain with example?

532


Explain locks? : Transact sql

567


Explain about various levels of constraint.

519


What is a constraint?

565


what is offset-fetch filter in tsql? : Transact sql

530


Can we create foreign key without primary key?

530


How do you create an update query?

517


What is scalar function?

564


Why is stored procedure faster than query?

486


1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins

1152