pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Sydney-Smith <richard@ibisaustralia.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: How do I replace select ... into commands?
Date: Fri, 12 Sep 2003 13:06:57 +0800
Message-ID: <002f01c378eb$b3fdaca0$df6c32d2@athlon2000> (raw)
References: <20030911194512.Q47864-100000@megazone.bigpanda.com>
	<001d01c378d9$d8a8bfc0$df6c32d2@athlon2000>
	<6095.1063336807@sss.pgh.pa.us>

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
>
>




view thread (6+ messages)  latest in thread

Message-ID: <002f01c378eb$b3fdaca0$df6c32d2@athlon2000>
Permalink:  ../002f01c378eb$b3fdaca0$df6c32d2@athlon2000/
Also on:    postgresql.org/message-id/002f01c378eb$b3fdaca0$df6c32d2@athlon2000

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: richard@ibisaustralia.com, tgl@sss.pgh.pa.us
  Subject: Re: How do I replace select ... into commands?
  In-Reply-To: <002f01c378eb$b3fdaca0$df6c32d2@athlon2000>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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