pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Willis <peterw@borstad.com>
To: Adrian Klaver <aklaver@comcast.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: FUNCTION problem
Date: Fri, 03 Apr 2009 12:10:02 -0700
Message-ID: <49D65F0A.70107@borstad.com> (raw)
In-Reply-To: <1381545833.2939121238777956737.JavaMail.root@sz0030a.emeryville.ca.mail.comcast.net>
References: <1381545833.2939121238777956737.JavaMail.root@sz0030a.emeryville.ca.mail.comcast.net>

Adrian Klaver wrote:
>
> 
> If you are using Postgres 8.1+ then it becomes even easier because you can use OUT parameters in the function argument list to eliminate the "as test(c1 int,c2 int)" clause. At this point it becomes a A-->B-->C problem i.e determine what your inputs are, how you want to process them and how you want to return the output.
> 

'8.1+'?? Hmmm, I'm using 8.3. I could use that.

I got the more complex version of the query to work
by backing away from 'plpgsql' as the language and using
'sql' instead.

I then nested (terribly ugly) my select statements to
generate a single SQL query from all. This allows
me to change the output of the query without needing
to define a new set of output 'OUT' parameters each time
I change things.

I have use of the 'OUT' parameters with another set
of functions though. Thanks for that.

Peter



view thread (13+ messages)

Message-ID: <49D65F0A.70107@borstad.com>
Permalink:  ../49D65F0A.70107@borstad.com/
Also on:    postgresql.org/message-id/49D65F0A.70107@borstad.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: peterw@borstad.com, aklaver@comcast.net
  Subject: Re: FUNCTION problem
  In-Reply-To: <49D65F0A.70107@borstad.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox