Problems With Insert Or Update Through Views (Doc ID 1217825.1)

Last updated on MAY 27, 2011

Applies to:

JDBC - Version: 11.2.0.1 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms


In Oracle 11.2.0.1.0 when executing an INSERT or an UPDATE through views based on tables with BLOB type columns following error is reported:
ORA-01461: can only bind a LONG value for insert into a LONG column

It takes place using JDK 1.5.0_16-b02 and with Oracle Database 11g Release 2 (11.2.0.1.0) JDBC Drivers libraries . It happens also with other JDK and JDBC versions.

When an INSERT with a small file (less than 4000bytes) is executed, then everything works fine. But if the cache is cleaned (alter system flush shared_pool) then the error strikes back (as long as the first INSERT or UPDATE is executed with a file smaller than 4000 bytes)

Please find attached the "test case" which produces the following error trace:
java.sql.SQLException: ORA-01461: can only bind a LONG value for insert into a LONG column
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3423)
at TestViewOra11.main(TestViewOra11.java:54)Exception in thread "main"


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms