Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 30DBD476057 for ; Thu, 23 May 2002 07:39:40 -0400 (EDT) Received: from tsmtp9.mail.isp (mailhost2.teleline.es [195.235.113.141]) by postgresql.org (Postfix) with ESMTP id 69E1A475C46 for ; Thu, 23 May 2002 07:35:41 -0400 (EDT) Received: from terra.es ([213.98.70.162]) by tsmtp9.mail.isp (Netscape Messaging Server 4.15 tsmtp9 Mar 14 2002 21:29:48) with ESMTP id GWKAT601.K4O for ; Thu, 23 May 2002 13:34:18 +0200 Message-ID: <3CECC5C5.BDF77592@terra.es> Date: Thu, 23 May 2002 12:34:45 +0200 From: Gabriel Dovalo Carril X-Mailer: Mozilla 4.76 [es] (X11; U; Linux 2.4.0-4GB i686) X-Accept-Language: en MIME-Version: 1.0 To: Lista SQL de postgres Subject: Functions with dynamic queries Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200205/253 X-Sequence-Number: 7888 Hi, I would appreciate it if somebody could send me some examples (or url) on how to create functions with text parameters, use these parameters to build a dynamic query and return a value obtained from that query. A very simple case would be: Create table people ( nif char(12), name varchar(40), primary (nif) ); And now to create a function to return "name" value giving "nif" values as a parameter. Thanks -- Gabriel D.