From: Chris Ruprecht <chrup999@yahoo.com>
To: pgsql <pgsql-sql@postgresql.org>
Subject: Re: Functions returning more than one value
Date: Wed, 8 Aug 2001 10:20:23 -0500
Message-ID: <006601c1201d$a56848e0$5dd26383@corp.compucom.com> (raw)
References: <web-98772@davinci.ethosmedia.com>
Josh,
the two functions are just a tiny example of what I want to do which is:
call a function with 2 or more arguments (v_val1 and v_val2).
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 know that this might not be good programming practice since many
applications rely on functions NOT changing the variables which get passed
to them as arguments. maybe if we could specially declare them as
'changeable' parameters ...
The functionality of 'returns record' is nice to have but it would not help
me in this case. I would have to create a record each time I want to pass
more than one value back to the calling procedure. This means 'disk access'
which is another word for 'this is going to slow down my program'. But this
reminds me: where are temp tables kept? On disk or in memory? - that might
be a way out of the dilemma.
Best regards,
Chris
----- Original Message -----
From: "Josh Berkus" <josh@agliodbs.com>
To: "Chris Ruprecht" <chrup999@yahoo.com>
Sent: Wednesday, August 08, 2001 10:06 AM
Subject: Re: [SQL] Functions returning more than one value
> Chris,
>
> > How can I get more than one value back from a function?
>
> I assume that you're looking for a workaround here. You've been on the
> list long enough to know that we're all waiting for record-returning
> ability in 7.2, 7.3 or more likely 8.0.
>
> > The most elegant would be something like the 2 functions listed
> > below. They
> > don't work, since v_val3 and v_val4 are treated as constants in
> > test2() and
> > can not be changed. Is there a way this can make it into a future
> > release?
>
> I'm *really* confused. These functions seem to have nothing to do with
> your first question. Mind documenting, line-by-line, what you're trying
> to do with the two functions you provided? I can't puzzle it out from
> your code.
>
> -Josh
>
> ______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
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
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: chrup999@yahoo.com
Subject: Re: Functions returning more than one value
In-Reply-To: <006601c1201d$a56848e0$5dd26383@corp.compucom.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