pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rodrigo De León <rdeleonp@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: inner join problem with temporary tables
Date: Sat, 16 Jun 2007 09:12:57 -0000
Message-ID: <1181985177.750508.66720@k79g2000hse.googlegroups.com> (raw)
In-Reply-To: <1181771551.123920.263780@a26g2000pre.googlegroups.com>
References: <1181771551.123920.263780@a26g2000pre.googlegroups.com>

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




Message-ID: <1181985177.750508.66720@k79g2000hse.googlegroups.com>
Permalink:  ../1181985177.750508.66720@k79g2000hse.googlegroups.com/
Also on:    postgresql.org/message-id/1181985177.750508.66720@k79g2000hse.googlegroups.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rdeleonp@gmail.com
  Subject: Re: inner join problem with temporary tables
  In-Reply-To: <1181985177.750508.66720@k79g2000hse.googlegroups.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox