Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 5A8799FB433 for ; Sat, 16 Jun 2007 06:13:01 -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 05568-03 for ; Sat, 16 Jun 2007 06:12:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 78D349FB3FD for ; Sat, 16 Jun 2007 06:13:00 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id DFFED3143D; Sat, 16 Jun 2007 11:12:58 +0200 (MET DST) From: =?iso-8859-1?q?Rodrigo_De_Le=F3n?= X-Newsgroups: pgsql.sql Subject: Re: inner join problem with temporary tables Date: Sat, 16 Jun 2007 09:12:57 -0000 Organization: http://groups.google.com Lines: 31 Message-ID: <1181985177.750508.66720@k79g2000hse.googlegroups.com> References: <1181771551.123920.263780@a26g2000pre.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Complaints-To: groups-abuse@google.com In-Reply-To: <1181771551.123920.263780@a26g2000pre.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-AR; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: k79g2000hse.googlegroups.com; posting-host=201.224.11.220; posting-account=zGrw3Q0AAADU1m7dOiE5S6vTNtvJ7FdA To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/116 X-Sequence-Number: 28606 Guillermo Arias ha escrito: > Why it does not work??? > thanks for your help What's wrong with: CREATE OR REPLACE FUNCTION test1( OUT art_cod character varying , OUT art_descri character varying , OUT exis_ubic character varying , OUT exis_qty numeric ) RETURNS SETOF record AS $BODY$ SELECT a.art_cod, a.art_descri, e.exis_ubic, e.exis_qty FROM articles a INNER JOIN existences e ON a.art_cod = e.art_cod; $BODY$ LANGUAGE 'sql' STABLE; SELECT * FROM test1(); art_cod | art_descri | exis_ubic | exis_qty ---------+------------+-----------+---------- 1 | nails | new york | 100 2 | hammers | dallas | 130 3 | wood | miami | 1390 3 | wood | baltimore | 390 3 | wood | louisiana | 20