how to create a multi columns return function ? - Mailing list pgsql-sql

From jclaudio@capitol.fr
Subject how to create a multi columns return function ?
Date
Msg-id OFC6DC4FE3.EDDE1832-ONC1256DC6.004816D3-C1256DC6.00482FCD@capitol.fr
Whole thread Raw
Responses Re: how to create a multi columns return function ?  (Adam Witney <awitney@sghms.ac.uk>)
Re: how to create a multi columns return function ?  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
<br /><font face="sans-serif" size="2">Hi</font><br /><br /><font face="sans-serif" size="2">I'm moving databases from
sybaseto postgres.</font><br /><font face="sans-serif" size="2">But I have difficulties in creating a postgres
equivalentto the sybase stored procedures...</font><br /><br /><font face="sans-serif" size="2">Apparently, Postgres
functionsshould work, but the syb stored procedures get only one parameter and return several colums</font><br /><br
/><fontface="sans-serif" size="2">Here's the code I wrote in postgresql :</font><br /><br /><font face="sans-serif"
size="2">createfunction function_name( int ) returns text</font><br /><font face="sans-serif" size="2">AS ' SELECT
column1,column2, column3,...,column15</font><br /><font face="sans-serif" size="2">FROM table_name</font><br /><font
face="sans-serif"size="2">WHERE colum1 = $1 AND column5 = \'specific value\' AND column8 = \'specific_value2 \'
'</font><br/><font face="sans-serif" size="2">LANGUAGE 'SQL';</font><br /><br /><font face="sans-serif" size="2">and I
getthe message error : returns multi columns</font><br /><br /><font face="sans-serif" size="2">I'm wondering too if
It'spossible to create a view with a parameter if functions don't work.</font><br /><br /><font face="sans-serif"
size="2">Hasanybody faced the same problem ?</font><br /><br /><font face="sans-serif" size="2">I need help</font><br
/><br/><font face="sans-serif" size="2">thanks</font> 

pgsql-sql by date:

Previous
From: Wilhelm Graiss
Date:
Subject: plpgsql related question: intervals and variables
Next
From: "geraldo"
Date:
Subject: function problem