Re: inner join problem with temporary tables - Mailing list pgsql-sql

From Rodrigo De León
Subject Re: inner join problem with temporary tables
Date
Msg-id 1181985177.750508.66720@k79g2000hse.googlegroups.com
Whole thread Raw
List pgsql-sql
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  |      1002       | hammers    | dallas
|      1303       | wood       | miami     |     13903       | wood       | baltimore |      3903       | wood       |
louisiana|       20
 



pgsql-sql by date:

Previous
From: chester c young
Date:
Subject: Re: trigger firing order
Next
From: John Gunther
Date:
Subject: joining a table whose name is stored in the primary record