Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B427F9FB488 for ; Thu, 10 May 2007 03:14:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 82793-04 for ; Thu, 10 May 2007 03:14:28 -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 3FF9A9FB454 for ; Thu, 10 May 2007 03:14:30 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis), id 0ML2xA-1Hm1v22s3b-0000p9; Thu, 10 May 2007 08:14:29 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1Hm1v1-0004tk-00 for pgsql-sql@postgresql.org; Thu, 10 May 2007 08:14:27 +0200 Date: Thu, 10 May 2007 08:14:27 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Passing input to a view? Message-ID: <20070510061427.GA16765@a-kretschmer.de> References: <4642B5C9.5000505@autoledgers.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4642B5C9.5000505@autoledgers.com.au> 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: V01U2FsdGVkX1/fiX992RepTnKbHJtV+ZS4M4q5ZLvo1JXABdg TIGXyGUbFMT9RV/5L5MVFAUnyFcnQgD/QFjxgX0S3PVwIb8AIl AQSojfn7pggyrT9dWQZCpZFS7X84hrl X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/75 X-Sequence-Number: 28355 am Thu, dem 10.05.2007, um 14:03:53 +0800 mailte Paul Lambert folgendes: > Is it possible to define a view to use input parameters rather than a > hard-wired value in a where clause? As far as i know, no. > Instead of having it set to 1-Jan-2007 and 10-May-2007 for the dates, > can I specify that those values should be passed to the view? Or would I > need to change this to an SQL language function? > > I can't find anything in the documentation that answers this, but maybe > I'm not looking hard enough. You can write a so called 'set returning function' instead. Read more: http://www.postgresql.org/docs/current/static/xfunc-sql.html#XFUNC-SQL-TABLE-FUNCTIONS Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net