Re: Invoking a function within a batch statement

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Evan Meagher <evan(dot)meagher(at)gmail(dot)com>
Cc: rob stone <floriparob(at)gmail(dot)com>, Vitalii Tymchyshyn <vit(at)tym(dot)im>, List <pgsql-jdbc(at)postgresql(dot)org>, Steven Schlansker <stevenschlansker(at)gmail(dot)com>
Subject: Re: Invoking a function within a batch statement
Date: 2016-08-19 13:03:23
Message-ID: CADK3HHLLDCJsA1sm99fSAib09=gs1dnyEU2QnDtPZPFszRJ99g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Well we don't actually have stored procs so we do the next best thing.. Let
us know how the call syntax works out for you

Dave Cramer

davec(at)postgresintl(dot)com
www.postgresintl.com

On 17 August 2016 at 11:55, Evan Meagher <evan(dot)meagher(at)gmail(dot)com> wrote:

> Thanks for the replies. I was under the impression that the `{call ...}`
> syntax in JDBC only applied to stored procedures, so that's good to know
> regarding functions that return refcursors. However, as Example 6.2 on
> that page <https://jdbc.postgresql.org/documentation/94/callproc.html>
> illustrates, one must use SELECT to invoke functions that return SETOF
> results.
>
> In my use case, the function boils down to the invocation of an INSERT
> statement, so there is no result. And more generally, it seems to me that
> JDBC should support the batch SETOF-returning function use case. That is to
> say, JDBC probably shouldn't reject non-none results as it currently seems
> to be.
>
> On Wed, Aug 17, 2016 at 8:16 AM, rob stone <floriparob(at)gmail(dot)com> wrote:
>
>>
>> On Wed, 2016-08-17 at 15:06 +0000, Vitalii Tymchyshyn wrote:
>> > I think you should be able to use {call proc(params)} form, see https
>> > ://jdbc.postgresql.org/documentation/80/callproc.html
>> > Best regards, Vitalii Tymchyshyn
>> >
>>
>> Or see https://jdbc.postgresql.org/documentation/94/callproc.html
>>
>> which is the latest doco.
>>
>> Note that 1209 is the most recent driver.
>>
>> HTH,
>> rob
>>
>
>
>
> --
> Evan Meagher
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vladimir Sitnikov 2016-08-19 15:00:34 Re: Invoking a function within a batch statement
Previous Message Evan Meagher 2016-08-17 15:55:34 Re: Invoking a function within a batch statement