pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Utilizing executeBatch() with stored procedures
4+ messages / 4 participants
[nested] [flat]

* Utilizing executeBatch() with stored procedures
@ 2006-06-30 00:47 Yukino Miyazawa <stchen001@yahoo.com>
  2006-06-30 16:37 ` Re: Utilizing executeBatch() with stored procedures Guy Rouillier <guyr@masergy.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Yukino Miyazawa @ 2006-06-30 00:47 UTC (permalink / raw)
  To: pgsql-jdbc

I was wondering what the status is for getting
CallableStatments to run via executeBatch() to get
inserts done in bulk. I've been attempting to get this
to work on 8.1.4 with the  8.2 503 driver. Despite my
return type being void, this fails to execute
returning a syntax error on "{" which is alluding to
the "{call func(? . . ."

Are there any known workarounds?

Thanks,
stchen

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Utilizing executeBatch() with stored procedures
  2006-06-30 00:47 Utilizing executeBatch() with stored procedures Yukino Miyazawa <stchen001@yahoo.com>
@ 2006-06-30 16:37 ` Guy Rouillier <guyr@masergy.com>
  2007-03-05 16:10   ` Re: Utilizing executeBatch() with stored procedures Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Guy Rouillier @ 2006-06-30 16:37 UTC (permalink / raw)
  To: pgsql-jdbc

Yukino Miyazawa wrote:
> I was wondering what the status is for getting CallableStatments to
> run via executeBatch() to get inserts done in bulk. I've been
> attempting to get this to work on 8.1.4 with the  8.2 503 driver.
> Despite my return type being void, this fails to execute returning a
> syntax error on "{" which is alluding to the "{call func(? . . ."    
> 
> Are there any known workarounds?

I've tried this myself and didn't get a syntax error.  However, invoking
stored functions in executeBatch currently does not work.  Even though
you use "call func" in your SQL command, the PostgreSQL JDBC driver maps
this to "select func" because that is what PG requires.  Now, even
though your stored function returns void, the result of a select is
always a ResultSet, empty in this case.  But that is enough to cause
executeBatch to generate an error complaining that no return value is
allowed.

I discussed with Kris Jurka a way to address this issue, but I haven't
had time to try his solution yet.

-- 
Guy Rouillier




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Utilizing executeBatch() with stored procedures
  2006-06-30 00:47 Utilizing executeBatch() with stored procedures Yukino Miyazawa <stchen001@yahoo.com>
  2006-06-30 16:37 ` Re: Utilizing executeBatch() with stored procedures Guy Rouillier <guyr@masergy.com>
@ 2007-03-05 16:10   ` Dave Cramer <pg@fastcrypt.com>
  2007-03-05 17:25     ` Re: Utilizing executeBatch() with stored procedures Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Dave Cramer @ 2007-03-05 16:10 UTC (permalink / raw)
  To: Guy Rouillier <guyr@masergy.com>; Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

Guy, Kris,

What was the suggested fix ?

Dave
On 30-Jun-06, at 12:37 PM, Guy Rouillier wrote:

> Yukino Miyazawa wrote:
>> I was wondering what the status is for getting CallableStatments to
>> run via executeBatch() to get inserts done in bulk. I've been
>> attempting to get this to work on 8.1.4 with the  8.2 503 driver.
>> Despite my return type being void, this fails to execute returning a
>> syntax error on "{" which is alluding to the "{call func(? . . ."
>>
>> Are there any known workarounds?
>
> I've tried this myself and didn't get a syntax error.  However,  
> invoking
> stored functions in executeBatch currently does not work.  Even though
> you use "call func" in your SQL command, the PostgreSQL JDBC driver  
> maps
> this to "select func" because that is what PG requires.  Now, even
> though your stored function returns void, the result of a select is
> always a ResultSet, empty in this case.  But that is enough to cause
> executeBatch to generate an error complaining that no return value is
> allowed.
>
> I discussed with Kris Jurka a way to address this issue, but I haven't
> had time to try his solution yet.
>
> -- 
> Guy Rouillier
>
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 6: explain analyze is your friend
>




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Utilizing executeBatch() with stored procedures
  2006-06-30 00:47 Utilizing executeBatch() with stored procedures Yukino Miyazawa <stchen001@yahoo.com>
  2006-06-30 16:37 ` Re: Utilizing executeBatch() with stored procedures Guy Rouillier <guyr@masergy.com>
  2007-03-05 16:10   ` Re: Utilizing executeBatch() with stored procedures Dave Cramer <pg@fastcrypt.com>
@ 2007-03-05 17:25     ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Kris Jurka @ 2007-03-05 17:25 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Guy Rouillier <guyr@masergy.com>; pgsql-jdbc



On Mon, 5 Mar 2007, Dave Cramer wrote:

> What was the suggested fix ?

Simply to ignore the error if we're in a CallableStatement.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2007-03-05 17:25 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-30 00:47 Utilizing executeBatch() with stored procedures Yukino Miyazawa <stchen001@yahoo.com>
2006-06-30 16:37 ` Guy Rouillier <guyr@masergy.com>
2007-03-05 16:10   ` Dave Cramer <pg@fastcrypt.com>
2007-03-05 17:25     ` Kris Jurka <books@ejurka.com>

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