X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A706BD1B519 for ; Fri, 12 Sep 2003 05:05:23 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 00819-02 for ; Fri, 12 Sep 2003 02:05:13 -0300 (ADT) Received: from server146.hostingrevolution.com (server146.hostingrevolution.com [64.21.143.245]) by svr1.postgresql.org (Postfix) with ESMTP id 7CFCED1B504 for ; Fri, 12 Sep 2003 02:05:12 -0300 (ADT) Received: from 223.a.002.pth.iprimus.net.au ([210.50.108.223] helo=athlon2000) by server146.hostingrevolution.com with smtp (Exim 4.22) id 19xg7J-0001yo-Qs; Fri, 12 Sep 2003 00:04:48 -0500 Message-ID: <002f01c378eb$b3fdaca0$df6c32d2@athlon2000> From: "Richard Sydney-Smith" To: "Tom Lane" Cc: References: <20030911194512.Q47864-100000@megazone.bigpanda.com> <001d01c378d9$d8a8bfc0$df6c32d2@athlon2000> <6095.1063336807@sss.pgh.pa.us> Subject: Re: How do I replace select ... into commands? Date: Fri, 12 Sep 2003 13:06:57 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server146.hostingrevolution.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - ibisaustralia.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/93 X-Sequence-Number: 15071 Thanks that fixed it. .... the more I use it the happier I get with postgresql. Best Regards Richard ----- Original Message ----- From: "Tom Lane" To: "Richard Sydney-Smith" Cc: "Stephan Szabo" ; Sent: Friday, September 12, 2003 11:20 AM Subject: Re: [SQL] How do I replace select ... into commands? > "Richard Sydney-Smith" 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 > >