Order by in stored functions

From: Andreas Tille <tillea(at)rki(dot)de>
To: PostgreSQL SQL <pgsql-sql(at)hub(dot)org>
Subject: Order by in stored functions
Date: 2000-09-04 05:18:00
Message-ID: Pine.LNX.4.21.0009040713470.16234-100000@wr-linux02.rki.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Sawtell 2000-09-04 07:47:08 Re: pg_hba.conf
Previous Message Richard Rowell 2000-09-04 01:24:16 Re: Auto increment