Thread: Re: inner join problem with temporary tables

Re: inner join problem with temporary tables

From
Rodrigo De León
Date:
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