function to return query result

From: Peter Maas <pm(at)mrinfo(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: function to return query result
Date: 2000-11-29 11:34:19
Message-ID: 3A24E9BB.BB91947A@mrinfo.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

this is the first time for me to post into this mailing list so
let me introduce myself: I'm working at a little software company
in Germany. We run a mixed Linux/Windows network. The workhorse is
a Linux Server running named, apache, samba and last not least a
PostgresQL 7.0.2 service.

Now my question: I tried to write a PL/PGSQL function that returns
a query result:

CREATE FUNCTION pms() RETURNS pmsummen AS '
declare
result pmsummen;
BEGIN
select into result * from pmsummen;
return result;
END;
' LANGUAGE 'plpgsql';

SELECT pms(); yields the error
NOTICE: plpgsql: ERROR during compile of pms near line 2
ERROR: parse error at or near "pmsummen"

I tried lots of variations of this function (employing PERFORM,
replacing pmsummen by record, ...) but everything failed. My
first intention was to write a parameterized view but this
doesn't seem to exist in PostgresQL so I tried to write a
function returning a query result. Thanks for your help.

Peter.

PS: Are there any pgsql newsgroups? Has muc.lists.postgres.
question something in common with this mailing list?

Peter.

--
------------------------------------------------------------------
Peter Maas, m+r infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-875094 Fax +49-241-875095 eMail pm(at)mrinfo(dot)de
------------------------------------------------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mart Käsper 2000-11-29 11:48:23 Retrieving arrays through JDBC
Previous Message Jeff Davis 2000-11-29 10:46:55 Access restriction