public inbox for [email protected]  
help / color / mirror / Atom feed
From: Martin Handsteiner <[email protected]>
To: David G. Johnston <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected] <[email protected]>
Subject: AW: stringtype=unspecified is null check problem
Date: Fri, 13 Jan 2023 10:16:10 +0000
Message-ID: <VI1PR1001MB1423CC078BC3A5D323F2D8D5E8C29@VI1PR1001MB1423.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAKFQuwatG9xxLm2bF+9-6LcvmhFqPFtszTDt5S+UG8Ljnfw7vw@mail.gmail.com>
References: <VI1PR1001MB1423CDC3E737B4763436B730E8FF9@VI1PR1001MB1423.EURPRD10.PROD.OUTLOOK.COM>
	<CAKFQuwZA+9+FNovGXA6moj+sDzR6ShyzzP3H77m-05n3dXDv-w@mail.gmail.com>
	<VI1PR1001MB1423C002817FECB26B1AFB3DE8FC9@VI1PR1001MB1423.EURPRD10.PROD.OUTLOOK.COM>
	<CAKFQuwZrn0F9RyM=WL9Z=pioGX5pwH1+mbBe-jGNnjy_J2E+Jw@mail.gmail.com>
	<[email protected]>
	<CAKFQuwYtmLLkmjaKghYXPnBWwvUvsqhZR=9J8KDcLzavf8707w@mail.gmail.com>
	<[email protected]>
	<CAKFQuwatG9xxLm2bF+9-6LcvmhFqPFtszTDt5S+UG8Ljnfw7vw@mail.gmail.com>


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




view thread (14+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: AW: stringtype=unspecified is null check problem
  In-Reply-To: <VI1PR1001MB1423CC078BC3A5D323F2D8D5E8C29@VI1PR1001MB1423.EURPRD10.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox