Joseph Shraibman wrote:
> How come executeUpdate() always returns 1 when the sql is SELECT ...
> INTO TEMP tablename ? I'm using pg 7.4.7
I just tried the CVS driver against 7.4.6 and 8.0.0 servers, and both
return 0 in this case, regardless of the actual number of rows inserted.
I don't have a 7.4.7 build to hand, but I'd expect it to behave the same
Returning 0 is ok according to the JDBC spec, which says that
executeUpdate returns "either the row count for INSERT, UPDATE or DELETE
statements, or 0 for SQL statements that return nothing". We can't
return a row count here anyway, as the server doesn't tell us the number
of rows inserted by a SELECT INTO.
If you're seeing a return value of 1, that does seem wrong. Can you
provide some test code showing the problem? We'd also need to know
exactly which driver build you are using.
The test code I used is attached.
In response to
pgsql-jdbc by date
|Next:||From: Javier Yáñez||Date: 2005-03-16 09:30:03|
|Subject: Charset encoding patch to JDBC driver|
|Previous:||From: Joseph Shraibman||Date: 2005-03-15 04:58:09|
|Subject: executeUpdate("SELECT INTO")|