X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AD3CA32A100 for ; Wed, 29 Sep 2004 14:49:08 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43448-06 for ; Wed, 29 Sep 2004 13:48:52 +0000 (GMT) Received: from nobelio.k8.com.br (nobelio.k8.com.br [200.185.109.96]) by svr1.postgresql.org (Postfix) with ESMTP id 3119732A103 for ; Wed, 29 Sep 2004 14:48:54 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by smtpa.k8.com.br (Postfix) with ESMTP id BFD1D5000497 for ; Wed, 29 Sep 2004 10:48:47 -0300 (BRT) Received: from smtpa.k8.com.br ([127.0.0.1]) by localhost (nobelio.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 22916-01 for ; Wed, 29 Sep 2004 10:48:47 -0300 (BRT) Received: from develop (200-102-070-180.paemt7003.dsl.brasiltelecom.net.br [200.102.70.180]) by smtpa.k8.com.br (Postfix) with ESMTP id 1CD4E5000482 for ; Wed, 29 Sep 2004 10:48:47 -0300 (BRT) From: Paulo Nievierowski To: X-Mailer: PocoMail 3.01 (1661) - Licensed Version Date: Wed, 29 Sep 2004 10:51:49 -0300 Message-ID: <2004929105149.835585@develop> Delivery-Date: Wed, 29 Sep 2004 10:51:49 -0000 Subject: SELECT with Function Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/254 X-Sequence-Number: 19100 Hello, This is my first message to pgsql-novice. I create plpgsql function "myfunc(integer)" thats returns of type record with values from table X (the function decides what record must be select). The parameter is an keyprod existing in table X and in table A. It run well sending in psql: SELECT * FROM myfunc( 10006530 ) as (vret1 numeric, vret2 numeric); The problem is: I need return data from table A (this have column 'keyprod'). This value (keyprod) must be passed as parameter to myfunc(). The result must be a union of columns selected from table A and result of myfunc(). How to create this query? It's possible? Thanks Paulo Nievierowski PS: Excuses my poor english.