not able to execute the cursor
990187Apr 23 2013 — edited Apr 23 2013declare
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?