pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Small problem with embedded comments in a statement
Date: Tue, 26 Sep 2006 11:07:52 +0200
Message-ID: <efaql9$jnj$1@sea.gmane.org> (raw)

Hello,

When running the following query:

String sql = "select * from table1\n" +
              "--select * from table2;\n" +
              "--select * from table3";			

I get an error:
org.postgresql.util.PSQLException: Multiple ResultSets were returned by the query.

But as the second and third SELECT are behing a comment, they should be ignored, 
right? Actually when removing the semicolon after table2, then everything works 
fine.

Is this a bug in the JDBC driver, or is this intended behaviour?

Best regards
Thomas

P.S.: before you ask why I run such a SQL statement: I'm maintaining an 
open-source query tool and sometimes unwanted statements are simply un-commented 
from within the editor, but the application still sends the whole string that 
the user supplied.




view thread (2+ messages)  latest in thread

Message-ID: <efaql9$jnj$1@sea.gmane.org>
Permalink:  ../efaql9$jnj$1@sea.gmane.org/
Also on:    postgresql.org/message-id/efaql9$jnj$1@sea.gmane.org

 · 

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: spam_eater@gmx.net
  Subject: Re: Small problem with embedded comments in a statement
  In-Reply-To: <efaql9$jnj$1@sea.gmane.org>
  References: <efaql9$jnj$1@sea.gmane.org>

* 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