Re: executing batch select queries

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: executing batch select queries
Дата
Msg-id 411615F9.1040904@opencloud.com
обсуждение исходный текст
Ответ на executing batch select queries  (ng@maritimesource.ca (Justin Kennedy))
Ответы Re: executing batch select queries
Список pgsql-jdbc
Justin Kennedy wrote:

> We use batch select queries quite a bit, and to accomplish this in
> Oracle we just separated the queries with "\n" and ran:
> stmt.executeQuery(sql).
>
> Doing this in PostgreSQL (with a semicolon as a delimeter) generates
> this error:
> Cannot handle multiple result groups.

Try the latest development driver from jdbc.postgresql.org. That version
should handle queries that return multiple resultsets correctly. This
was added in build 303. It hasn't had huge amounts of testing, though,
since it's an uncommonly used feature.

> But this doesn't:
> stmt.clearBatch();
> stmt.addBatch("select * from pay_methods");
> stmt.executeBatch();
>
> The following error is output:
> Batch entry 0 .... Call getNextException() to see the cause. calling
> getNextException() produces this:
> A result was returned when none was expected.

Yeah, this isn't ever going to work, the JDBC spec requires the driver
to complain if you give a SELECT-style query to addBatch() (and how
would you get the results, anyway?)

-O

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Problems with charsets, investigated...
Следующее
От: Jose Miguel Madinaveitia Ramirez
Дата:
Сообщение: Re: Problems with big tables.