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
What are the types of queries in sql?
What is rownum in sql?
Mention what is the plv (pl/vision) package offers?
how to add a new column to an existing table in mysql? : Sql dba
What does trigger mean in slang?
What is offset in sql query?
Explain how can you save or place your msg in a table?
What is difference between my sql and sql?
what is self join and what is the requirement of self join? : Sql dba
What is substitution variable in pl sql?
What problem one might face while writing log information to a data-base table in pl/sql?
When are we going to use truncate and delete?
How many types of literals are available in pl sql?
What does trigger mean in psychology?
Can we use pl sql in mysql?