| From: | Michael Fuhr <mike(at)fuhr(dot)org> |
|---|---|
| To: | Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: question about about future 8.1 and IN, INOUT, and OUT parameters |
| Date: | 2005-04-26 01:03:52 |
| Message-ID: | 20050426010352.GA9840@winnie.fuhr.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Sun, Apr 24, 2005 at 11:05:57PM -0500, Tony Caduto wrote:
>
> I saw that the recently released pl/java has the ablity to use IN, INOUT, and
> OUT parameters.
>
> Is the syntax going to be exactly like it is in Oracle?
I'm not familiar with the Oracle syntax and I don't know how close
the PostgreSQL implementation is to being final, but here's an
example that works with the most recent code from HEAD (8.1devel):
CREATE FUNCTION foo(IN x integer, INOUT y integer, OUT z integer) AS $$
BEGIN
y := y + 5;
z := x + 5;
END;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
SELECT foo(10, 20);
foo
---------
(25,15)
(1 row)
SELECT (foo(10, 20)).*;
y | z
----+----
25 | 15
(1 row)
SELECT (foo).* FROM (SELECT foo(10, 20)) AS s;
y | z
----+----
25 | 15
(1 row)
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Christopher Kings-Lynne | 2005-04-26 01:40:19 | Re: OpenRPT (was Re: [ANNOUNCE] == PostgreSQL Weekly |
| Previous Message | Eric B. Ridge | 2005-04-26 00:24:03 | Corruption on production system |