Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 2C1FD9FA0ED for ; Wed, 11 Jul 2007 13:44:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 11585-03 for ; Wed, 11 Jul 2007 13:43:57 -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 2619C9F9ECD for ; Wed, 11 Jul 2007 13:44:05 -0300 (ADT) Received: from www.88thstreet.com (localhost [IPv6:::1]) by rootabega.88thstreet.com (8.13.3/8.13.3) with ESMTP id l6BGi26k003047 for ; Wed, 11 Jul 2007 12:44:02 -0400 (EDT) Received: from 63.118.86.10 (SquirrelMail authenticated user radhika) by www.88thstreet.com with HTTP; Wed, 11 Jul 2007 12:44:02 -0400 (EDT) Message-ID: <25976.63.118.86.10.1184172242.squirrel@www.88thstreet.com> Date: Wed, 11 Jul 2007 12:44:02 -0400 (EDT) Subject: 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/54 X-Sequence-Number: 28789 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. Is there a way to select data using EXECUTE? Thanks. Radhika