Re: [GENERAL] ORDER BY with plpgsql parameter

2004-06-02 Thread Richard Huxton
Thomas Schoen wrote: You need to use the FOR-IN-EXECUTE style of query. That way you can use any string you want (including text passed in as a parameter) to build the query inside the function ... that is what i want to avoid. (i wrote that in my first mail) My question was about why it is not po

Re: [GENERAL] ORDER BY with plpgsql parameter

2004-06-02 Thread Thomas Schoen
> You need to use the FOR-IN-EXECUTE style of query. That way > you can use any string you want (including text passed in as > a parameter) to build the query inside the function ... that is what i want to avoid. (i wrote that in my first mail) My question was about why it is not possible to do it

Re: [GENERAL] ORDER BY with plpgsql parameter

2004-06-01 Thread Lee Harr
is it possible to use a parameter of a plpgsql-function to order a selection inside the function? You need to use the FOR-IN-EXECUTE style of query. That way you can use any string you want (including text passed in as a parameter) to build the query inside the function ... http://www.postgresql.

[GENERAL] ORDER BY with plpgsql parameter

2004-06-01 Thread Thomas Schoen
Hi, is it possible to use a parameter of a plpgsql-function to order a selection inside the function? What i would like to do is pass a column-name/alias-name to a plpgsql function and use the variable as order-by-parameter like this: create function foo(varchar) RETURNS SETOF test AS '