Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id CF5B2475909 for ; Fri, 8 Mar 2002 11:16:05 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 73032D5F7; Fri, 8 Mar 2002 08:16:10 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 647ED5BFC; Fri, 8 Mar 2002 08:16:10 -0800 (PST) Date: Fri, 8 Mar 2002 08:16:10 -0800 (PST) From: Stephan Szabo To: Dalton Shane Cc: Subject: Re: problem with RECORD in a stored procedure In-Reply-To: <200203081502.PAA28287@cs.may.ie> Message-ID: <20020308081530.E834-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200203/100 X-Sequence-Number: 6981 On Fri, 8 Mar 2002, Dalton Shane wrote: > > HI, > > I have a strange problem with regard to the RECORD type. IN plpgsql language it > doesn't seem to recognise the data type. Does anybody have any idea why? I've > included a sample function and the terminal output to show what I mean. I've > also included what should have gone into table orla. > > Any help would be appreciated in sorting out this frustrating problem. > > Shane > > CREATE FUNCTION sinead() RETURNS integer AS ' > DECLARE > a integer :=0; > b RECORD; > > > BEGIN > FOR b IN SELECT MIN(total) from results LOOP > INSERT INTO orla(total) VALUES(b); You need to specify an attribute of b to insert here (for example b.min). > END LOOP; > > RETURN a; > > > END; > ' LANGUAGE 'plpgsql';