Order by in stored functions

Поиск
Список
Период
Сортировка
От Andreas Tille
Тема Order by in stored functions
Дата
Msg-id Pine.LNX.4.21.0009040713470.16234-100000@wr-linux02.rki.de
обсуждение исходный текст
Ответы Re: Order by in stored functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hello

I tried to create the following function

CREATE Function pGetMenu ( int ) returns setof varchar As '   SELECT IdMenuShow || IdWebPage   FROM   Menu   WHERE
IdMenu= $1    ORDER BY IdSort ; ' language 'SQL' ;
 

I've got the following error message:

ERROR:  function declared to return varchar returns multiple values in final retrieve

If O just remove the ORDER BY clause als works well so I guess that the
ORDER BY has to be replaced by somethjing other.  Could somebody
enlighten me how to do the ordering in a stored procedure?

Kind regards
         Andreas.



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

Предыдущее
От: "Richard Rowell"
Дата:
Сообщение: Re: Auto increment
Следующее
От: Craig May
Дата:
Сообщение: pg_hba.conf