| From: | John DeSoi <desoi(at)pgedit(dot)com> |
|---|---|
| To: | PostgreSQL SQL <pgsql-sql(at)postgresql(dot)org> |
| Subject: | plpgsql select into with multiple target variables |
| Date: | 2005-01-28 21:02:13 |
| Message-ID: | E21F7476-716F-11D9-8D86-000A95B03262@pgedit.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | PFC | 2005-01-28 21:11:49 | Re: plpgsql select into with multiple target variables |
| Previous Message | Franco Bruno Borghesi | 2005-01-28 15:46:50 | Re: Calendar Function |