> create or replace function callfunc(OUT val integer) returns integer as $$ select 1::integer; $$ > language sql;
> prepare cf (void) as select callfunc($1);
> execute cf('text');
I know, this test case is not about problems with calling functions with jdbc, but as we are still in jdbc mailing list:
A good test case for java would be a function with mixed in / out params, first in then out.
create or replace function callfunc(in val1 integer, in val2 integer, in out val3 integer, out val4 integer) returns void
The out values are mapped to the wrong indexes 1 and 2 because result from db is {1, 1} but jdbc throws exception, that 1 and 2 is not registered as out param…
So calling functions with out param from jdbc only works when out params are first.
We solved that by calling functions with
SELECT * FROM callfunc(?, ?, ?)
And mapping the result by our own to the correct indexes.