Write a function to accept project name as input and returns the
number of employees working on the project.
Write a function to accept project name as input and returns the
number of employees working on the project.
---->>>>
create or replace function emp(v varchar(25)) returns int as
'
declare
r1 project%rowtype;
r2 proemp%rowtype;
r3 employee1%rowtype;
ch int := 0;
begin
for r1 in select * from project where ptype = v
loop
if r1.pno= r2.pno then
loop
if r2.eno= r3.eno THEN
raise notice '' % % % '', r3.ename,r3.qualifi , r3.dateJ ;
end if;
ch := ch+1;
end loop;
end if ;
end loop;
return ch;
end;
'language'plpgsql';
0 Comments