Re: function retuning refcursor, order by ignored?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: function retuning refcursor, order by ignored?
Дата
Msg-id 20070530184739.GD18387@svana.org
обсуждение исходный текст
Ответ на Re: function retuning refcursor, order by ignored?  (novnov <novnovice@gmail.com>)
Список pgsql-general
On Wed, May 30, 2007 at 11:40:15AM -0700, novnov wrote:
>
> 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). I've called like so:

What you're doing is equivalent to ORDER BY 'constant' which is totally
meaningless. If you want to control the column name dynamically, you
need to build the query dynamically, with EXECUTE for example.

>           ORDER BY "pstr_orderby";

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Uhm, so, yeah, speaking of /.
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: function retuning refcursor, order by ignored?