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
Why do we use joins in sql?
How do I find duplicates in a single column in sql?
how do you control the max size of a heap table? : Sql dba
Which sql statement is used to return only different values?
What are the benefits of stored procedures?
What is procedure explain with example?
Explain locks? : Transact sql
Explain about various levels of constraint.
What is a constraint?
what is offset-fetch filter in tsql? : Transact sql
Can we create foreign key without primary key?
How do you create an update query?
What is scalar function?
Why is stored procedure faster than query?
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