pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
question about AbstractJdbc2Statement
4+ messages / 3 participants
[nested] [flat]

* question about AbstractJdbc2Statement
@ 2007-05-24 06:24  Luca Ferrari <fluca1978@infinito.it>
  0 siblings, 1 reply; 4+ messages in thread

From: Luca Ferrari @ 2007-05-24 06:24 UTC (permalink / raw)
  To: pgsql-jdbc

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



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

* Re: question about AbstractJdbc2Statement
@ 2007-05-24 12:04  Oliver Jowett <oliver@opencloud.com>
  parent: Luca Ferrari <fluca1978@infinito.it>
  0 siblings, 2 replies; 4+ messages in thread

From: Oliver Jowett @ 2007-05-24 12:04 UTC (permalink / raw)
  To: Luca Ferrari <fluca1978@infinito.it>; +Cc: pgsql-jdbc

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



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

* Re: question about AbstractJdbc2Statement
@ 2007-05-24 12:49  Luca Ferrari <fluca1978@infinito.it>
  parent: Oliver Jowett <oliver@opencloud.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Luca Ferrari @ 2007-05-24 12:49 UTC (permalink / raw)
  To: pgsql-jdbc

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




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

* Re: question about AbstractJdbc2Statement
@ 2007-05-24 14:09  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Oliver Jowett <oliver@opencloud.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Tom Lane @ 2007-05-24 14:09 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: Luca Ferrari <fluca1978@infinito.it>; pgsql-jdbc

Oliver Jowett <oliver@opencloud.com> 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



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


end of thread, other threads:[~2007-05-24 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-05-24 06:24 question about AbstractJdbc2Statement Luca Ferrari <fluca1978@infinito.it>
2007-05-24 12:04 ` Oliver Jowett <oliver@opencloud.com>
2007-05-24 12:49   ` Luca Ferrari <fluca1978@infinito.it>
2007-05-24 14:09   ` Tom Lane <tgl@sss.pgh.pa.us>

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