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 insert delete data in view?
What is the difference between a subquery and a join?
How many commands are there in sql?
What is primary key and foreign key?
What is string data type in sql?
What is composite primary key in sql?
what are the properties and different types of sub-queries? : Sql dba
what is unique key constraint? : Sql dba
How do you delete duplicates in sql query using rowid?
How many sql databases can you have on one server?
how to rename an existing table in mysql? : Sql dba
how to get a list of indexes of an existing table? : Sql dba
What kind of join is join?
what are the advantages and disadvantages of cascading style sheets? : Sql dba
What are the parameter modes supported by pl/sql?