pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Albert László-Róbert <albertlaszlorobert@gmail.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: PSQLException: Too many update results were returned.
Date: Sat, 04 Aug 2007 04:11:54 +0300
Message-ID: <46B3D25A.7000103@gmail.com> (raw)
In-Reply-To: <46B3CF4F.4020705@opencloud.com>
References: <373352.78463.qm@web32701.mail.mud.yahoo.com>
	<46B3CBA0.3040203@opencloud.com>
	<46B3CDEB.2060608@gmail.com>
	<46B3CF4F.4020705@opencloud.com>

Oliver Jowett wrote:
> Albert László-Róbert wrote:
>
>> yes, the statements are semicolon-separated. than you have some idea how
>> to make it to work?
>
> Try adding only one statement per addBatch() i.e. instead of
>
>   stmt.addBatch("insert a; insert b; insert c");
>
> do:
>
>   stmt.addBatch("insert a");
>   stmt.addBatch("insert b");
>   stmt.addBatch("insert c");
i wish i can do that. the files that contains those statements are up to
500k ... and the majority of the code contain function implementations.

exists some software that can extract these statements?
>
>> note: if i use a simple executeUpdate for multiple inserts that are
>> semicolon-separated, than they work.
>
> Yes, executeUpdate is a different code path that does understand
> semicolon-separated paths.
>
> The batch code expects exactly one command status per addBatch(). It's
> not clear from the JDBC API what you're meant to do with an addBatch()
> call that returns more than one thing, since executeBatch() is meant
> to return one array element (representing the update status) per
> addBatch() call AFAIK.
>
> -O
>

albertlr



view thread (15+ messages)  latest in thread

Message-ID: <46B3D25A.7000103@gmail.com>
Permalink:  ../46B3D25A.7000103@gmail.com/
Also on:    postgresql.org/message-id/46B3D25A.7000103@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: albertlaszlorobert@gmail.com, oliver@opencloud.com
  Subject: Re: PSQLException: Too many update results were returned.
  In-Reply-To: <46B3D25A.7000103@gmail.com>
  References: <373352.78463.qm@web32701.mail.mud.yahoo.com> <46B3CBA0.3040203@opencloud.com> <46B3CDEB.2060608@gmail.com> <46B3CF4F.4020705@opencloud.com> <46B3D25A.7000103@gmail.com>

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

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