ORA-01461: can bind a LONG value only for insert into a LONG column-Occurs when querying

Rupesh picture Rupesh · Feb 6, 2012 · Viewed 273.6k times · Source

When I try to query objects, I end up with following error:

ORA-01461: can bind a LONG value only for insert into a LONG column

Could someone please help me on the cause and solution of the problem?

Answer

Kiran picture Kiran · Jan 24, 2013

It can also happen with varchar2 columns. This is pretty reproducible with PreparedStatements through JDBC by simply

  1. creating a table with a column of varchar2 (20 or any arbitrary length) and
  2. inserting into the above table with a row containing more than 20 characters

So as above said it can be wrong with types, or column width exceeded.

Also note that as varchar2 allows 4k chars max, the real limit will be 2k for double byte chars

Hope this helps