ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6050, maximum: 4000)

Hello,

in Aspose Words for Java I do the following:

ResultSet rs = preparedStatement.executeQuery();

TemplateBase templateBase = new TemplateBase();
templateBase.setWhereValue(brosch);

DataSet dataSet = new DataSet();

DataTable dtData = new DataTable(rs, "Broschuere"); //<--- exception happens here
dataSet.getTables().add(dtData);

But with some data I get this ugly exception:

java.sql.SQLException: ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6050, maximum: 4000)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
    at oracle.jdbc.driver.T4CPreparedStatement.fetch(T4CPreparedStatement.java:1119)
    at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:373)
    at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:277)
    at com.aspose.words.net.System.Data.zzY.zzY(Unknown Source)
    at com.aspose.words.net.System.Data.DataTable.refresh(Unknown Source)
    at com.aspose.words.net.System.Data.DataTable.&lt;init&gt;(Unknown Source)
    at it.siag.wave.report.Report.brochure(Report.java:355)
    at it.siag.wave.report.Test.main(Test.java:75)

This exception is generated from Aspose Words 16.7.0, but I tried the latest version and have the exact same behaviour.

Is this an Aspose bug, or can I do something to make this work?

@siagit

To ensure a timely and accurate response, please create a simple Java application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing. We will investigate the issue on our side and provide you more information.

Hello @tahir.manzoor, thanks for the answer. The relevant code snippet is there. Reading the exception I think the bug is somehow triggered by the data returned by the query. I don’t think I can post a dump of the database for you to reproduce the problem.
Can I somehow help in a different way?

@siagit

From the shared exception detail, it seems that this issue is not related to Aspose.Words. Please check the following web link. Hope this helps you.
Error- ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion

Hi @tahir.manzoor, the query executes without problems in sqlplus. There is no raw to char conversion or other type casts whatsoever in the executed query. Also, the query worked just fine for a few years, but broke sometime this year, most probably because the underlying data changed. There are a lot of records, so I can’t pinpoint exactly what record breaks Aspose.

No I’m wrong. I had a row fetch limit set for the query and the error is because of something in the query, not Aspose, as you suggested. Sorry for the spam.

@siagit

It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.