Received: from cs.may.ie (l3ult25.cs.may.ie [149.157.246.225]) by postgresql.org (Postfix) with ESMTP id AA6734758E9 for ; Fri, 8 Mar 2002 10:07:54 -0500 (EST) Received: from l2sol29 (l2sol29 [149.157.244.139]) by cs.may.ie (8.9.3/8.9.1) with SMTP id PAA28287 for ; Fri, 8 Mar 2002 15:02:19 GMT Message-Id: <200203081502.PAA28287@cs.may.ie> Date: Fri, 8 Mar 2002 15:06:16 +0000 (GMT) From: Dalton Shane Reply-To: Dalton Shane Subject: problem with RECORD in a stored procedure To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: elAOWzfEjdfC46r8dMylvw== X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.3.2 SunOS 5.7 i86pc i386 X-Archive-Number: 200203/99 X-Sequence-Number: 6980 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); END LOOP; RETURN a; END; ' LANGUAGE 'plpgsql'; ------------------------------------------------------------------------- ballina=# select sinead(); ERROR: Attribute 'b' not found -------------------------------------------------------------------------- ballina=# select MIN(total) from results; min ----- 2 (1 row) ---------------------------------------------------------------------------