Re: How do I replace select ... into commands? - Mailing list pgsql-sql

From Richard Sydney-Smith
Subject Re: How do I replace select ... into commands?
Date
Msg-id 002f01c378eb$b3fdaca0$df6c32d2@athlon2000
Whole thread Raw
In response to Re: How do I replace select ... into commands?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-sql
Thanks that fixed it.
.... the more I use it the happier I get with postgresql.

Best Regards
Richard
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Richard Sydney-Smith" <richard@ibisaustralia.com>
Cc: "Stephan Szabo" <sszabo@megazone.bigpanda.com>;
<pgsql-sql@postgresql.org>
Sent: Friday, September 12, 2003 11:20 AM
Subject: Re: [SQL] How do I replace select ... into commands?


> "Richard Sydney-Smith" <richard@ibisaustralia.com> writes:
> >       execute ''select max('' || seq_fld || '') into mx from '' || tbl;
>
> You can't use INTO in an EXECUTE'd select (basically because the string
> to be executed is not processed by plpgsql at all, merely sent down to
> the SQL engine, which does not know the output variable mx).  The way to
> get results out of an executed select is to use FOR ... IN EXECUTE.
> Which is a kluge, but it holds the fort until someone gets around to
> redesigning this code.  See the manual.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>
>



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: How do I replace select ... into commands?
Next
From: sad
Date:
Subject: how to call a function with row-type arg