pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dalton Shane <se401029@cs.may.ie>
To: pgsql-sql@postgresql.org
Subject: problem with RECORD in a stored procedure
Date: Fri, 8 Mar 2002 15:06:16 +0000 (GMT)
Message-ID: <200203081502.PAA28287@cs.may.ie> (raw)


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)

---------------------------------------------------------------------------




view thread (3+ messages)  latest in thread

Message-ID: <200203081502.PAA28287@cs.may.ie>
Permalink:  ../200203081502.PAA28287@cs.may.ie/
Also on:    postgresql.org/message-id/200203081502.PAA28287@cs.may.ie

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: se401029@cs.may.ie
  Subject: Re: problem with RECORD in a stored procedure
  In-Reply-To: <200203081502.PAA28287@cs.may.ie>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox