ORA-01461 Can Bind A Long Value Only For Insert Into A Long Column (Doc ID 387587.1)

Last updated on JULY 05, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Microsoft Windows (32-bit)
***Checked for relevance on 13th Jul 2016 ***

Symptoms

Working with a Windows client.

Normally when binding, the OCIBindByName call expects the size of the data being passed in. The value is passed via the value_sz parameter of the OCIBindByName call.

When dynamically binding (using the OCI_DATA_AT_EXEC) it usually means the data and size is unknown until run-time which leads to the question of what does the value_sz parameter pertain to.

If the actual data size will be 500, using a size 167 works but using a size 166 fails with the following error:

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

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