question about AbstractJdbc2Statement
question about AbstractJdbc2Statement
От:
Luca Ferrari <fluca1978@infinito.it>
Дата:
Hi all,
in the org.postgresql.jdbc2.AsbtractJdbc2Statement#executeQuery there's:
if (result.getNext() != null)
throw new PSQLException(GT.tr("Multiple ResultSets were returned
by the query."), PSQLState.TOO_MANY_RESULTS);
It is not clear to me when an executeQuery could have multiple result sets as
result, since the execution of the query thru the queryexecutor seems to me
to exploit the SendOneQuery method. Is this related to the batch processing
or something I'm missing from SQL? Can somebody explain me when multiple
resultset can be returned from a query?
Thanks,
Luca
Re: question about AbstractJdbc2Statement
От:
Oliver Jowett <oliver@opencloud.com>
Дата:
Luca Ferrari wrote:
> Can somebody explain me when multiple
> resultset can be returned from a query?
stmt.execute("SELECT * FROM table1; SELECT * FROM table2");
-O
Re: question about AbstractJdbc2Statement
От:
Luca Ferrari <fluca1978@infinito.it>
Дата:
On Thursday 24 May 2007 Oliver Jowett's cat, walking on the keyboard, wrote:
> Luca Ferrari wrote:
> > Can somebody explain me when multiple
> > resultset can be returned from a query?
>
> stmt.execute("SELECT * FROM table1; SELECT * FROM table2");
>
In this case, instead of processing both the queries and then throwing an
exception, should not be better to parse the string and send an exception
before processing the queries?
Just curios!
Luca
Re: question about AbstractJdbc2Statement
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Oliver Jowett writes:
> Luca Ferrari wrote:
>> Can somebody explain me when multiple
>> resultset can be returned from a query?
> stmt.execute("SELECT * FROM table1; SELECT * FROM table2");
Or stmt.execute("UPDATE foo SET ...") where foo has a couple of
ON UPDATE DO ALSO SELECT ... rules.
regards, tom lane