Re: function retuning refcursor, order by ignored?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: function retuning refcursor, order by ignored?
Дата
Msg-id 20070530185303.GK7128@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: function retuning refcursor, order by ignored?  (novnov <novnovice@gmail.com>)
Ответы Re: function retuning refcursor, order by ignored?  (novnov <novnovice@gmail.com>)
Список pgsql-general
novnov escribió:
>
> While a hard coded order by clause works; passing the order by as a param is
> ignored as I've implemented below.  The order by value is being passed as
> expected (tested by outputing the value in a column).

It doesn't because the value is expanded as a constant, therefore all
rows have the same value and the sort is a no-op.  Try using EXECUTE
(although I admit I don't know if you are able to do an OPEN CURSOR with
EXECUTE)


--
Alvaro Herrera                 http://www.amazon.com/gp/registry/CTMLCN8V17R4
Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green
stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'.
After collecting 500 such letters, he mused, a university somewhere in
Arizona would probably grant him a degree.              (Don Knuth)

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: function retuning refcursor, order by ignored?
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Uhm, so, yeah, speaking of /.