Skip site navigation (1) Skip section navigation (2)

Re: PSQLException: Too many update results were returned.

From: Albert László-Róbert <albertlaszlorobert(at)gmail(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PSQLException: Too many update results were returned.
Date: 2007-08-04 01:11:54
Message-ID: 46B3D25A.7000103@gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2007-08-04 01:17:17
Subject: Re: PSQLException: Too many update results were returned.
Previous:From: Oliver JowettDate: 2007-08-04 01:02:05
Subject: Re: PSQLException: Too many update results were returned.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group