Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AA6239FB394 for ; Wed, 11 Jul 2007 14:35:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 50769-07 for ; Wed, 11 Jul 2007 14:35:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from rootabega.88thstreet.com (dsl254-071-237.nyc1.dsl.speakeasy.net [216.254.71.237]) by postgresql.org (Postfix) with ESMTP id 621A89FB24D for ; Wed, 11 Jul 2007 14:35:46 -0300 (ADT) Received: from www.88thstreet.com (localhost [IPv6:::1]) by rootabega.88thstreet.com (8.13.3/8.13.3) with ESMTP id l6BHZhB6004205 for ; Wed, 11 Jul 2007 13:35:43 -0400 (EDT) Received: from 63.118.86.10 (SquirrelMail authenticated user radhika) by www.88thstreet.com with HTTP; Wed, 11 Jul 2007 13:35:43 -0400 (EDT) Message-ID: <32082.63.118.86.10.1184175343.squirrel@www.88thstreet.com> In-Reply-To: <20070711170806.GA26121@a-kretschmer.de> References: <25474.63.118.86.10.1184172081.squirrel@www.88thstreet.com> <20070711170806.GA26121@a-kretschmer.de> Date: Wed, 11 Jul 2007 13:35:43 -0400 (EDT) Subject: Re: using EXECUTE on Selects From: "Radhika Sambamurti" To: pgsql-sql@postgresql.org Reply-To: radhika@88thstreet.com User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/58 X-Sequence-Number: 28793 Thanks! That worked. I really could'nt make sense of the documentation, the way it was worded. I tested it out and it works. Thanks again! Radhika > am Wed, dem 11.07.2007, um 12:41:21 -0400 mailte Radhika Sambamurti > folgendes: >> Hi, >> >> Here is my need: >> >> I have to select data by building up the where clause: >> example: WHERE firm = 'nnn' >> WHERE firm = 'nnn' AND symbol = 'bbb' >> WHERE date BETWEEN 'startdate' AND 'enddate' AND symbol = 'bbb' >> >> And so on. >> >> I was hoping to write a function where I can build up my where clause >> (dynamic sql) and use the EXECUTE command with it. But I just read that >> the SELECT INTO has not been implemented for use with EXECUTE. > > You can use "execute sql into foo;" with sql your dynamic sql and foo > your variable to store the result. > > > Andreas > -- > Andreas Kretschmer > Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) > GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > -- It is all a matter of perspective. You choose your view by choosing where to stand. Larry Wall ---