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


Please Help Members By Posting Answers For Below Questions

What does t sql mean?

702


Is postgresql a nosql database?

789


Does sap use sql?

715


Why functions are used in sql?

699


What are the two types of exceptions in pl/sql?

729






Can two tables have same primary key?

725


What is difference between hql and sql?

697


hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews

1739


What are the two types of exceptions.

814


What is the difference between microsoft sql and mysql?

707


Can there be more than one function with a similar name in a pl/sql block?

742


How do you identify a primary key?

810


how many sql ddl commands are supported by 'mysql'? : Sql dba

700


How do you explain an index number?

744


what is the difference between join and union? : Sql dba

715