Re: question about about future 8.1 and IN, INOUT, and OUT parameters - Mailing list pgsql-general

From Michael Fuhr
Subject Re: question about about future 8.1 and IN, INOUT, and OUT parameters
Date
Msg-id 20050426010352.GA9840@winnie.fuhr.org
Whole thread Raw
In response to question about about future 8.1 and IN, INOUT, and OUT parameters  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
Responses Re: question about about future 8.1 and IN, INOUT, and OUT parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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/

pgsql-general by date:

Previous
From: "Eric B. Ridge"
Date:
Subject: Corruption on production system
Next
From: Alvaro Herrera
Date:
Subject: Re: Corruption on production system