Unix Technical Forum

plpgsql select into with multiple target variables

This is a discussion on plpgsql select into with multiple target variables within the pgsql Sql forums, part of the PostgreSQL category; --> The docs say: The result of a SELECT command yielding multiple columns (but only one row) can be assigned ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Sql

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 11:54 AM
John DeSoi
 
Posts: n/a
Default plpgsql select into with multiple target variables

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


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:34 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com