[JDBC-33] update-or-insert does not work with oracle Created: 21/May/12 Updated: 10/Jun/12 Resolved: 10/Jun/12
|Reporter:||Brian Tatnall||Assignee:||Sean Corfield|
According to the oracle documentation
As documented update-values returns (-2) which means that the (if (zero?)) check in update-or-insert-values will never return true.
Oracle does provide the number of rows updated via an the method getUpdateCount on instances of Statement.
The following change fixes this problem for oracle users, but I am not sure how it will affect other drivers.
|Comment by Sean Corfield [ 22/May/12 12:17 AM ]|
Interesting. (.getUpdateCount stmt) is a standard part of the JDBC API so it looks reasonable to see if the result of the (.executeBatch stmt) is a single sequence with a -2 value, the code could call (.getUpdateCount stmt) and return that (single) value as a sequence. It looks like that should be completely portable but it will be hard to test since none of the other DBs return -2 as far as I know and I don't have an Oracle install to test against