AW: stringtype=unspecified is null check problem - Mailing list pgsql-jdbc

From Martin Handsteiner
Subject AW: stringtype=unspecified is null check problem
Date
Msg-id VI1PR1001MB1423CC078BC3A5D323F2D8D5E8C29@VI1PR1001MB1423.EURPRD10.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: stringtype=unspecified is null check problem  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-jdbc

 

> 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.


pgsql-jdbc by date:

Previous
From: Martin Handsteiner
Date:
Subject: AW: stringtype=unspecified is null check problem
Next
From: Vladimir Sitnikov
Date:
Subject: [pgjdbc/pgjdbc]