In response to Anton Marchenkov :
> Hi!
>
> I'm trying to use the order by parameter inside a function, but it is
> ignored. Any ideas why? And how can I sort by external parameters inside
> pgsql function?
You an use dynamic SQL with EXECUTE, for instance:
create or replace function my_order
On Tuesday 2. June 2009, Anton Marchenkov wrote:
>CREATE OR REPLACE FUNCTION "public"."test_order_by" (sort_key varchar)
>RETURNS SETOF "customers"."customers_with_mark_deleted" AS
>$body$
>DECLARE
> rec RECORD;
>BEGIN
> FOR rec IN SELECT * FROM customers.customers_with_mark_deleted c
>
On Tuesday 2. June 2009, Anton Marchenkov wrote:
>Hi!
>
>I'm trying to use the order by parameter inside a function, but it is
>ignored. Any ideas why? And how can I sort by external parameters
> inside pgsql function?
What's the problem with
SELECT * FROM foo(myvar) ORDER BY sort_key ASC
?
If
Hi!
I'm trying to use the order by parameter inside a function, but it is
ignored. Any ideas why? And how can I sort by external parameters inside
pgsql function?
CREATE OR REPLACE FUNCTION "public"."test_order_by" (sort_key varchar)
RETURNS SETOF "customers"."customers_with_mark_deleted" AS