From: Jon C. <jon...@gm...> - 2016-01-20 21:50:48
|
I've run into a problem with zxJDBC and clobs. The code: from com.ziclix.python.sql import zxJDBC as DBAPI ... crs.execute("update session set xml=? " "where " "id=1", [xml_clob], {0:DBAPI.CLOB}) Generates the error: crs.execute("update session set xml=? " Error: ORA-01461: can bind a LONG value only for insert into a LONG column [SQLCode: 1461], [SQLState: 72000] I have to use the actual clob datatype here, as using the STRING data type produces: crs.execute("update session set xml=? " Error: error setting index [1], type [12] [SQLCode: 0] setString can only process strings of less than 32766 chararacters [SQLCode: 17157] The problem is no longer critical to me as I've managed to work around it by using direct JDBC calls: ps=db.__connection__.prepareStatement("update session set xml=? " "where " "id=1" ) ps.setStringForClob(1,xml_clob) ps.executeUpdate() However, even with that workaround, I'm a bit nervous as to if that statement executes in the same transaction as the others. Is the zxJDBC clob code broken, or am I somehow using it incorrectly? FWIW, I'm running Jython 2.7.0 installed via brew on Mac OS 10.10.5. Thanks for any help you can provide. -Jon |