how to create a multi columns return function ?

Поиск
Список
Период
Сортировка
От jclaudio@capitol.fr
Тема how to create a multi columns return function ?
Дата
Msg-id OF85EC3ADD.CB4C28BD-ONC1256DC6.004ABFB0-C1256DC6.004AD2C7@capitol.fr
обсуждение исходный текст
Ответы Re: how to create a multi columns return function ?
Список pgsql-novice

Hi

I'm moving databases from sybase to postgres.
But I have difficulties in creating a postgres equivalent to the sybase stored procedures...

Apparently, Postgres functions should work, but the syb stored procedures get only one parameter and return several colums

Here's the code I wrote in postgresql :

create function function_name( int ) returns text
AS ' SELECT column1, column2, column3,...,column15
FROM table_name
WHERE colum1 = $1 AND column5 = \'specific value\' AND column8 = \'specific_value2 \' '
LANGUAGE 'SQL';

and I get the message error : returns multi columns

I'm wondering too if It's possible to create a view with a parameter if functions don't work.

Has anybody faced the same problem ?

I need help

thanks

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Ed Fair"
Дата:
Сообщение: Novice dumb questions.
Следующее
От: "Eric S. Johansson"
Дата:
Сообщение: Re: Getting up and running on Red Hat 9