plpgsql select into with multiple target variables - Mailing list pgsql-sql

From John DeSoi
Subject plpgsql select into with multiple target variables
Date
Msg-id E21F7476-716F-11D9-8D86-000A95B03262@pgedit.com
Whole thread Raw
Responses Re: plpgsql select into with multiple target variables
List pgsql-sql
The docs say:

The result of a SELECT command yielding multiple columns (but  only one 
row) can be assigned to a record variable, row-type  variable, or list 
of scalar variables. This is done by:
SELECT INTO target  select_expressions  FROM ...;
where target can be a record variable, a row  variable, or a 
comma-separated list of simple variables and  record/row fields. The 
select_expressions  and the remainder of the command are the same as in 
regular SQL.

So, I'm trying to do the "list of scalar variables" target, but I can't 
get the syntax right. Something like

SELECT into varx, vary, varz,  colx, coly, colz, FROM ....

I've tried parens and various other things but no luck.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL



pgsql-sql by date:

Previous
From: Franco Bruno Borghesi
Date:
Subject: Re: Calendar Function
Next
From: PFC
Date:
Subject: Re: plpgsql select into with multiple target variables