On Tue, Jan 25, 2005 at 11:14:20AM +1100, Alexander Borkowski wrote:
>
> You have the order for pl/pgsql SELECT INTO wrong (target variable(s)
> first, then the value(s) you want to assign)
Either order is correct:
SELECT INTO var field FROM ...
SELECT field INTO var FROM ...
See the SELECT INTO documentation:
http://www.postgresql.org/docs/8.0/static/plpgsql-statements.html#PLPGSQL-SELECT-INTO
"The INTO clause can appear almost anywhere in the SELECT statement.
Customarily it is written either just after SELECT as shown above,
or just before FROM that is, either just before or just after the
list of select_expressions."
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/