Re: function to return query result

From: Peter Maas <pm(at)mrinfo(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: function to return query result
Date: 2000-11-30 10:48:15
Message-ID: 3A26306F.68E798BF@mrinfo.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)mrinfo(dot)de
------------------------------------------------------------------

Browse pgsql-general by date

  From Date Subject
Next Message Peter Maas 2000-11-30 10:56:19 Re: function to return query result
Previous Message Poul L. Christiansen 2000-11-30 09:56:15 Re: backup and store oids