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
what is meant by nl2br()? : Sql dba
What is foreign key and example?
what is difference between delete and truncate commands? : Sql dba
What is the difference between delete and truncate commands?
Define concurrency control. : Transact sql
What is pragma in pl sql?
What is a heap in sql?
What is cursor in pl sql with examples?
Explain alias in sql?
does sql support programming? : Sql dba
what is a primary key? : Sql dba
How many joins in sql?
What is a call statement? Explain with an example.
What is the importance of sqlcode and sqlerrm?
How to get list of all tables from a database?