Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

not able to execute the cursor

990187Apr 23 2013 — edited Apr 23 2013
declare
cursor ccns is
select b.bname || ' borrowed ' || to_char(c.the_count) || decode(c.the_count,1,' time',' times')
from books b,
(select bid,count(*) the_count
from borrowing
group by bid
) c
where b.bid = c.bid
cts ccns%rowtype;
begin
open ccns;
loop
fetch ccns into cts;
exit when ccns%notfound;
dbms_output.put_line(' ');
end loop;
close ccns;
/


the o/p has to be displayed as the bookname has been purchased 1 time
bookname has been purchased 1 time
bookname has been purchased 1 time
can anyone plz help me out?
This post has been answered by davidp 2 on Apr 23 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2013
Added on Apr 23 2013
3 comments
74 views