pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
plpgsql select into with multiple target variables
2+ messages / 2 participants
[nested] [flat]

* plpgsql select into with multiple target variables
@ 2005-01-28 21:02 John DeSoi <desoi@pgedit.com>
  2005-01-28 21:11 ` Re: plpgsql select into with multiple target variables PFC <lists@boutiquenumerique.com>
  0 siblings, 1 reply; 2+ messages in thread

From: John DeSoi @ 2005-01-28 21:02 UTC (permalink / raw)
  To: 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




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

* Re: plpgsql select into with multiple target variables
  2005-01-28 21:02 plpgsql select into with multiple target variables John DeSoi <desoi@pgedit.com>
@ 2005-01-28 21:11 ` PFC <lists@boutiquenumerique.com>
  0 siblings, 0 replies; 2+ messages in thread

From: PFC @ 2005-01-28 21:11 UTC (permalink / raw)
  To: John DeSoi <desoi@pgedit.com>; pgsql-sql



	Try removing the comma after varz

> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>





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


end of thread, other threads:[~2005-01-28 21:11 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-28 21:02 plpgsql select into with multiple target variables John DeSoi <desoi@pgedit.com>
2005-01-28 21:11 ` PFC <lists@boutiquenumerique.com>

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