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


Please Help Members By Posting Answers For Below Questions

mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql

566


What is data modelling in sql?

523


What is view explain with example?

521


What is pivot table in sql?

526


What are the different sql commands?

521






Explain the structure of pl/sql in brief.

621


How do you truncate?

507


how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

548


What are the advantages of normalization?

558


What is denormalization in a database?

593


what is the difference between ereg_replace() and eregi_replace()? : Sql dba

556


Define SQL and state the differences between SQL and other conventional programming Languages?

686


Which join condition can be specified using on clause?

517


What is nosql example?

585


What version is sql?

553