Doubt in Plpgsql - Mailing list pgsql-admin

From shreedhar
Subject Doubt in Plpgsql
Date
Msg-id 001501c2054a$cc98f410$1201a8c0@a4005
Whole thread Raw
List pgsql-admin
Hi all,
    I am sorry for putting this question in this list. Hope some body may know 'plpgsql' in postgres.
    As I am practicing plpgsql I wrote the following code which is not retrieving data.
 
declare
 temprec record;
 funcs text;
 funcid integer;
 
begin
 funcs := 'success';
 
 for temprec in select * from tbldefaultaccounts loop
 -- if record belongs to project function
  if temprec.isfunction = 't' then
   funcid := 1;
   select functionid into funcid from tblFunctionHierarchy where HierarchyName = temprec.fname;
   funcs := funcs || ', ' ||  funcid ;
 
  end if;
 end loop;
 
 return funcs;
 
end;
 
Can any body say what is problem with this code. I hope it might have problem after where condition.
 
where tbldefaultaccounts is
            daccid serial;
            fname varchar(50);
 
and tblFunctionHierarchy is
        functionid serial;
        name varchar(50);

pgsql-admin by date:

Previous
From: Niclas Gustafsson
Date:
Subject: Re: Problem with ucred.h building 7.2.1
Next
From: l.malaspina@focal.fr
Date:
Subject: Réf. : Re: File systems backup problem