Re: function to return query result - Mailing list pgsql-general

From Peter Maas
Subject Re: function to return query result
Date
Msg-id 3A26306F.68E798BF@mrinfo.de
Whole thread Raw
In response to function to return query result  (Peter Maas <pm@mrinfo.de>)
List pgsql-general
Ashley Clark wrote:
>Why don't you use a view? Something like:
>
>create view test as select a.a, a.b, a.c, b.a, b.b
>from a, b
>where a.id=b.id;
>
>Then you can do selects on the view using a where clause:
>
>select *
>from test
>where a.a='somevalue';

Hi,

yes, but I wanted to encapsulate the more complicated data internals
(joins, sub queries, etc) in server functions. I could have used
the server functions or parameterized views in many places. Now if I
need the results e.g. in PHP, Java and a Windows program I have to
code and to maintain 3 functions performing the same task. Sometimes
a recordset evaluation needs more than one step with intermediate
temporary tables etc. You need a function for this.

Thanks for your help,

Peter.

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

pgsql-general by date:

Previous
From: Peter Maas
Date:
Subject: Re: function to return query result
Next
From: "Gordan Bobic"
Date:
Subject: Built in Functions use with recordsets