Write a cursor to display the names of items whose rate is more
than 500.
Write a cursor to display the names of items whose rate is more
than 500.
--->>>
create or replace function item( ) returns int as
'
declare
c1 cursor for select * from item ;
r1 project%rowtype;
ch int :=0;
begin
open c1;
loop
fetch c1 into r1;
exit when not found;
if r1. rate> 500 then
raise notice ''% '', r1.iname;
end if;
ch := ch+1;
end loop;
close c1;
return ch;
end;
'language 'plpgsql';
0 Comments