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

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

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

From: Brian Peasland <dba_at_remove_spam.peasland.com>
Date: Mon, 03 Nov 2003 18:46:57 -0600
Message-ID: <vqdtnos3180ke5@corp.supernews.com>


You might want to check out the following link from AskTom where he shows how to read a CLOB using Java/JDBC:

http://asktom.oracle.com/pls/ask/f?p=4950:8:6997409950300052730::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1310802216301,

HTH,
Brian

On Monday 03 November 2003 00:18, Abhisek thoughtfully contributed:
> 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 - 18:46:57 CST

Original text of this message

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