Doubt in Plpgsql

From: "shreedhar" <shreedhar(at)lucidindia(dot)net>
To: "pgsql" <pgsql-admin(at)postgresql(dot)org>
Subject: Doubt in Plpgsql
Date: 2002-05-27 06:50:30
Message-ID: 001501c2054a$cc98f410$1201a8c0@a4005
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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);

Browse pgsql-admin by date

  From Date Subject
Next Message l.malaspina 2002-05-27 07:38:59 Réf. : Re: File systems backup problem
Previous Message Niclas Gustafsson 2002-05-26 21:00:51 Re: Problem with ucred.h building 7.2.1