Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A05769FB410 for ; Wed, 11 Jul 2007 14:08:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06529-03-3 for ; Wed, 11 Jul 2007 14:08:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by postgresql.org (Postfix) with ESMTP id D98BF9FB599 for ; Wed, 11 Jul 2007 14:08:11 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), id 0ML25U-1I8ffb28Ps-0004Ee; Wed, 11 Jul 2007 19:08:08 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1I8ffa-0006oH-00 for pgsql-sql@postgresql.org; Wed, 11 Jul 2007 19:08:06 +0200 Date: Wed, 11 Jul 2007 19:08:06 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: using EXECUTE on Selects Message-ID: <20070711170806.GA26121@a-kretschmer.de> References: <25474.63.118.86.10.1184172081.squirrel@www.88thstreet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25474.63.118.86.10.1184172081.squirrel@www.88thstreet.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX19JjB/bMQPwr4fz3EsZo5HxWiQeBTxMRvvAZgt mh06Rn2GeuUBfU54aWmAMlV0qbRMR+UeqQPRcgo4ldIX8AVpsi Dmaq+kABB7Hnup+gnmwaR22Df/oa8Vo X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/57 X-Sequence-Number: 28792 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