Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Oracle Error (ORA-21560 and ORA-06512) while converting the CLOB data of length 75K into String or Reader or InputStream?

Oracle Error (ORA-21560 and ORA-06512) while converting the CLOB data of length 75K into String or Reader or InputStream?

From: Abhisek <atandon_at_ipolicynet.com>
Date: 2 Nov 2003 22:18:54 -0800
Message-ID: <2b3fdab2.0311022218.2b5c9a3f@posting.google.com>


Hi,

When I am trying to retrieve the CLOB data of length of ~75KB from the Oracle database using JDBC (oracle.sql.CLOB) and converting it to String by using subString function of oracle.sql.CLOB, I am getting the following exception:

java.sql.SQLException: ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 715
ORA-06512: at line 1

at java.lang.Throwable.fillInStackTrace(Native Method) 
at java.lang.Throwable.fillInStackTrace(Compiled Code) 
at java.lang.Throwable.<init>(Compiled Code) 
at java.lang.Exception.<init>(Compiled Code) 
at java.sql.SQLException.<init>(Compiled Code) 
at oracle.jdbc.ttc7.TTIoer.processError(Compiled Code) 
at oracle.jdbc.ttc7.Oall7.receive(Compiled Code) 
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(Compiled Code) 
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(Compiled Code) 
at oracle.jdbc.driver.OracleStatement.doExecuteOther(Compiled Code) at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(Compiled Code)
at oracle.jdbc.driver.OracleStatement.doExecute(Compiled Code) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Compiled Code
)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(Compiled Cod
e)
at oracle.jdbc.driver.OraclePreparedStatement.execute(Compiled Code) 
at oracle.sql.CLOB.plsql_read(Compiled Code) 
at oracle.jdbc.ttc7.TTC7Protocol.lobRead(Compiled Code) 
at oracle.sql.CLOB.getChars(Compiled Code) 
at oracle.sql.CLOB.getSubString(Compiled Code) 

It is working fine for the data upto the size of 30K.

Can you please let me know is there any limit on fetching the CLOB data as a String or as a Character Stream? Is there any way to fetch the CLOB data of any length (upto 2MB) into the String class or as the character stream (as Reader) or in a InputStream?

I used APIs getSubString(), getAsciiStream and getCharStream to read the data from the clob but in all cases I am getting the exception with same oracle error.

I am fetching the data from the database in the servlet for the internal use in the servlet.

Please help me out.

Regards
Abhishek Received on Mon Nov 03 2003 - 00:18:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US