pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vincent AE Scott <pgsql-sql@codex.net>
To: pgsql-sql@postgresql.org
Subject: Re: How do you return more than one variable in a plpgsql function?
Date: Fri, 8 Feb 2002 02:13:32 +0000
Message-ID: <20020208021332.W25018@majestic.ukshells.co.uk> (raw)
In-Reply-To: <3C62E6FC.1040208@kepnet.net>
References: <3C62E6FC.1040208@kepnet.net>

Mark Nielsen(python@kepnet.net)@Thu, Feb 07, 2002 at 03:43:40PM -0500:
> I have never figured out how to make a plpgsql function return more than 
> one variable or type. I read something where a function an return an 
> open cursor, but I never figured out how. I want a function to be able 
> to return an entire row of a table or a number of fields from different 
> tables using plpgsql.
> 
> How can I do that?
> Thanks!
> Mark

i'm certainly no expert on postgres, but one option i can think of,
would be to insert the data into a 'temporary' table.  then return the
unique ID for that data.

certainly not perfect, but flexible.

HTH,
-vince

-- 
PGP key:  http://codex.net/pgp/pgp.asc

 Computers make very fast, very accurate mistakes.




view thread (2+ messages)

Message-ID: <20020208021332.W25018@majestic.ukshells.co.uk>
Permalink:  ../20020208021332.W25018@majestic.ukshells.co.uk/
Also on:    postgresql.org/message-id/20020208021332.W25018@majestic.ukshells.co.uk

 · 

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: pgsql-sql@codex.net
  Subject: Re: How do you return more than one variable in a plpgsql function?
  In-Reply-To: <20020208021332.W25018@majestic.ukshells.co.uk>

* 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