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 / sai
First open the cursor and fetch the records then u get the
required output.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Can we join same table in sql?
Why is pl sql used?
what is the stuff function and how does it differ from the replace function? : Sql dba
How can I see all tables in sql?
What are the types of variable use in pl sql?
Is sql better than access?
What is a table?
What is the meaning of disabling a trigger?
What is use of package in pl sql?
what is a database lock ? : Sql dba
How do you update sql?
Is nosql relational?
Does sql view stored data?
What is a variable in sql?
How does cross join work?