Order by in stored functions - Mailing list pgsql-sql

From Andreas Tille
Subject Order by in stored functions
Date
Msg-id Pine.LNX.4.21.0009040713470.16234-100000@wr-linux02.rki.de
Whole thread Raw
Responses Re: Order by in stored functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hello

I tried to create the following function

CREATE Function pGetMenu ( int ) returns setof varchar As '   SELECT IdMenuShow || IdWebPage   FROM   Menu   WHERE
IdMenu= $1    ORDER BY IdSort ; ' language 'SQL' ;
 

I've got the following error message:

ERROR:  function declared to return varchar returns multiple values in final retrieve

If O just remove the ORDER BY clause als works well so I guess that the
ORDER BY has to be replaced by somethjing other.  Could somebody
enlighten me how to do the ordering in a stored procedure?

Kind regards
         Andreas.



pgsql-sql by date:

Previous
From: "Richard Rowell"
Date:
Subject: Re: Auto increment
Next
From: Craig May
Date:
Subject: pg_hba.conf