My Oracle Support Banner

ERROR: ORA-24817 "Unable to allocate the given chunk for current lob operation" When Inserting Clob Larger Than 15 Mb (Doc ID 780248.1)

Last updated on JULY 05, 2017

Applies to:

Oracle Data Provider for .NET - Version and later
Microsoft Windows (32-bit)
***Checked for relevance on 28-Oct-2014***


Executing a .NET application to insert a LOB into the database fails with:

ORA-24817: Unable to allocate the given chunk for current lob operation

In this scenario:

CLOB's are >15 MB, error occurs.
CLOB's are <15 MB, are successfully inserted into database.


  ClobExample3.cs shows how to update a CLOB
  using the GetOracleClobForUpdate() method of an OracleDataReader

using System;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

class ClobExample3
  public static void Main()
    // create an OracleConnection object to connect to the
    // database and open the connection
    OracleConnection myOracleConnection =
      new OracleConnection(
        "User Id=lob_user;Password=lob_password"

    // create an OracleCommand object to hold a SQL statement
    OracleCommand myOracleCommand = myOracleConnection.CreateCommand();

    // step 1: create an OracleTransaction object
    OracleTransaction myOracleTransaction =

    // step 2: read the row
    myOracleCommand.CommandText =
      "SELECT id, clob_column " +
      "FROM clob_content " +
      "WHERE id = 1";
    OracleDataReader myOracleDataReader =

    Console.WriteLine("myOracleDataReader[\"id\"] = " +

    // step 3: get the LOB locator
    OracleClob myOracleClob =

    // step 4: write to the LOB
    string text = "It is the east, and Juliet is the Sun";
    char [] charArray = text.ToCharArray();
    myOracleClob.Write(charArray, 0, charArray.Length);
    Console.WriteLine("myOracleClob.Value = " + myOracleClob.Value);

    // step 5: commit the transaction
    Console.WriteLine("Successfully committed transaction");

    // close the OracleDataReader and the OracleConnection object

    Console.WriteLine("\nPress any key to end");



To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.