Roald Andresen
Roald Andresen

Reputation: 23

Extended length for varchar2 in Oracle 12c

I thought I should give the new extended varchar2 limits in my Java application. Here's what I've done so far:

  1. Changed MAX_STRING_SIZE to EXTENDED according to the recommended procedure.
  2. Extended the column in question to 32767 characters.
  3. Ran the program.

Java call ResultSet.updateString( str, idx ) runs fine, but when I come to ResultSet.updateRow(), I end up in a Java exception referring to an Oracle error:

java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

Complete error stack (or at least the part that doesn't refer to my code) follows:

java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:947)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3462)
at oracle.jdbc.driver.UpdatableResultSet.executeUpdateRow(UpdatableResultSet.java:3317)
at oracle.jdbc.driver.UpdatableResultSet.updateRow(UpdatableResultSet.java:2281)

As far as I can reckon, this should be it. But either I have forgotten something fundamental, or this must be a bug (perhaps in the jdbc library).

Upvotes: 0

Views: 1210

Answers (1)

Jean de Lavarene
Jean de Lavarene

Reputation: 3763

You must use the JDBC driver from 12c.

Upvotes: 1

Related Questions