Re: Multiple return values and assignment

From: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Multiple return values and assignment
Date: 2009-04-27 19:37:47
Message-ID: 200904272137.47709.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Monday 27. April 2009, Jasen Betts wrote:

>SELECT * FROM get_sort(par_id, srt, txt) INTO srt,txt;

Thank you very much! That saved me from one composite variable
declaration and two superfluous lines of code. I've settled for

SELECT number, string FROM get_sort(par_id, srt, txt) INTO srt, txt;

as that seems a little tidier.

I probably should have thought of it myself, but I wrongly assumed that
it was impossible to do multiple assignments like this in plpgsql.
--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2009-04-27 20:29:09 Re: Storing null bytes in bytea
Previous Message Jure Kobal 2009-04-27 19:11:59 Re: Query with Parameters and Wildcards