pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Chris Ruprecht <chrup999@yahoo.com>
To: pgsql <pgsql-sql@postgresql.org>
Subject: Re: Functions returning more than one value
Date: Wed, 08 Aug 2001 09:26:56 -0700
Message-ID: <web-98839@davinci.ethosmedia.com> (raw)
In-Reply-To: <006601c1201d$a56848e0$5dd26383@corp.compucom.com>

Chris,

> The called function (test2() in the example) will MODIFY the two
> arguments
> and then return a true value. After test2() has run, the value of the
> two
> arguments 'has changed' to what test2() has assigned to them.

I understand, now.  You're trying to replicate the functionality
provided in programming languages using By Reference arguments.

I could suggest a number of workarounds.  However, I think rather that
you should give serious consideration to *not* doing this in PL/pgSQL
but doing it in a full-featured procedural (and/or Object Oriented)
language instead.  Java, Python, Perl and even 4GL would provide you
with more robust functionality.

For example, what you want is easily done in Java just by passing the
input parameters as By Reference.

Opinions on Middleware languages, anyone?

-Josh Berkus


______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



view thread (4+ messages)  latest in thread

Message-ID: <web-98839@davinci.ethosmedia.com>
Permalink:  ../web-98839@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-98839@davinci.ethosmedia.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: josh@agliodbs.com, chrup999@yahoo.com
  Subject: Re: Functions returning more than one value
  In-Reply-To: <web-98839@davinci.ethosmedia.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