pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How do you return more than one variable in a plpgsql function?
2+ messages / 2 participants
[nested] [flat]

* How do you return more than one variable in a plpgsql function?
@ 2002-02-07 20:43 Mark Nielsen <python@kepnet.net>
  2002-02-08 02:13 ` Re: How do you return more than one variable in a plpgsql function? Vincent AE Scott <pgsql-sql@codex.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Mark Nielsen @ 2002-02-07 20:43 UTC (permalink / raw)
  To: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How do you return more than one variable in a plpgsql function?
  2002-02-07 20:43 How do you return more than one variable in a plpgsql function? Mark Nielsen <python@kepnet.net>
@ 2002-02-08 02:13 ` Vincent AE Scott <pgsql-sql@codex.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Vincent AE Scott @ 2002-02-08 02:13 UTC (permalink / raw)
  To: pgsql-sql

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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-02-08 02:13 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-07 20:43 How do you return more than one variable in a plpgsql function? Mark Nielsen <python@kepnet.net>
2002-02-08 02:13 ` Vincent AE Scott <pgsql-sql@codex.net>

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