Re: How do you return more than one variable in a plpgsql function?

From: Vincent AE Scott <pgsql-sql(at)codex(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How do you return more than one variable in a plpgsql function?
Date: 2002-02-08 02:13:32
Message-ID: 20020208021332.W25018@majestic.ukshells.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mark Nielsen(python(at)kepnet(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bill Cunningham 2002-02-08 03:47:34 Re: Help with a SQL query
Previous Message Josh Berkus 2002-02-07 23:22:43 Re: ALTER TABLE and dropping a column