Re: function retuning refcursor, order by ignored? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: function retuning refcursor, order by ignored?
Date
Msg-id 20070530184739.GD18387@svana.org
Whole thread Raw
In response to Re: function retuning refcursor, order by ignored?  (novnov <novnovice@gmail.com>)
List 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.

Attachment

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Uhm, so, yeah, speaking of /.
Next
From: Alvaro Herrera
Date:
Subject: Re: function retuning refcursor, order by ignored?