Home » SQL & PL/SQL » SQL & PL/SQL » Inserting More than 32,000 Characters to NCLOB field (Oracle 11G)
Inserting More than 32,000 Characters to NCLOB field [message #390316] Thu, 05 March 2009 22:54 Go to next message
chandruthala
Messages: 5
Registered: March 2009
Location: INDIA
Junior Member

Hi, I have to insert 50,000 Characters to NCLOB field of 11G database without using procedures. Is there any solution?
Re: Inserting More than 32,000 Characters to NCLOB field [message #390317 is a reply to message #390316] Thu, 05 March 2009 22:58 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Hi, I have to insert 50,000 Characters to NCLOB field of 11G database without using procedures.
What can you use?
What is your definition of a "procedure"?
What is the source of the 50,000 characters?

[Updated on: Thu, 05 March 2009 23:00]

Report message to a moderator

Re: Inserting More than 32,000 Characters to NCLOB field [message #390333 is a reply to message #390316] Fri, 06 March 2009 00:42 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Yes there are many solutions.
For instance, use SQL*Loader.

Regards
Michel
Re: Inserting More than 32,000 Characters to NCLOB field [message #390344 is a reply to message #390317] Fri, 06 March 2009 01:12 Go to previous messageGo to next message
chandruthala
Messages: 5
Registered: March 2009
Location: INDIA
Junior Member

Thanks for reply.. Actually i am sending the 50,000 characters from UI to webservice written in J2EE. There the database transactions are handled by the EntityManager(which can support persist, merge and delete operations). I am getting error like the maximum characters that can be inserted to table is 32,766.
Re: Inserting More than 32,000 Characters to NCLOB field [message #390346 is a reply to message #390316] Fri, 06 March 2009 01:16 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I am getting error like the maximum characters that can be inserted to table is 32,766.
if you do not answer my questions, then I won't answer yours
& you are the one who has the problem which needs saving.

Re: Inserting More than 32,000 Characters to NCLOB field [message #390348 is a reply to message #390344] Fri, 06 March 2009 01:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
There is no problem for a web service to insert a NCLOB (whatever is its size) using the proper calls (depending on the used language).

Regards
Michel
Re: Inserting More than 32,000 Characters to NCLOB field [message #390355 is a reply to message #390346] Fri, 06 March 2009 01:28 Go to previous messageGo to next message
chandruthala
Messages: 5
Registered: March 2009
Location: INDIA
Junior Member

This is the client-code
sample.setTermsAndConditions("Here we have the 50,000 characters");
sample.setCreated(new Timestamp(5000L));
sample.setBizSpacePartyId(40L);
sample.setRowId(18993L);
sample.setBizSpaceName("vchenn987ai");
sessionEJB.mergeEntity(sample);

When i run this sample-client in JDeveloper, I am getting errors. This is the stacl trace

javax.ejb.EJBException: An exception occurred during transaction completion: ; nested exception is:
javax.transaction.RollbackException: returning error in transaction: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: setString can only process strings of less than 32766 chararacters
Error Code: 17157

Caused by: javax.transaction.RollbackException: returning error in transaction: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: setString can only process strings of less than 32766 chararacters
  • Attachment: log.txt
    (Size: 491.17KB, Downloaded 1282 times)
Re: Inserting More than 32,000 Characters to NCLOB field [message #390374 is a reply to message #390355] Fri, 06 March 2009 02:58 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
This is your problem:
Internal Exception: java.sql.SQLException: setString can only process strings of less than 32766 chararacters
 Error Code: 17157


This is a Java error, not an Oracle one. You'll need to look further into the code to see what exactly is going on.
Re: Inserting More than 32,000 Characters to NCLOB field [message #390379 is a reply to message #390355] Fri, 06 March 2009 03:15 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Sounds like TopLink translated your CLOB column into a String instead of a compliant Java datatype
Re: Inserting More than 32,000 Characters to NCLOB field [message #390627 is a reply to message #390379] Mon, 09 March 2009 00:38 Go to previous messageGo to next message
chandruthala
Messages: 5
Registered: March 2009
Location: INDIA
Junior Member

Hi, I had old jdbc version. 10.1.0. Now i have downloaded the latest one 10.2.0.4 and create the shared library in Oc4j with ojdbc14.jar and orai18n.jar.

But now I am getting error different error
[B]javax.ejb.EJBException: java.lang.NoSuchMethodError: oracle.sql.converter.CharacterConverters.toUnicodeChars([BI[CII)I; nested exception is:
java.lang.NoSuchMethodError: oracle.sql.converter.CharacterConverters.toUnicodeChars([BI[CII)I; nested exception is: oracle.oc4j.rmi.OracleRemoteException: java.lang.NoSuchMethodError: oracle.sql.converter.CharacterConverters.toUnicodeChars([BI[CII)I; nested exception is:
java.lang.NoSuchMethodError: oracle.sql.converter.CharacterConverters.toUnicodeChars([BI[CII)I
oracle.oc4j.rmi.OracleRemoteException: java.lang.NoSuchMethodError: oracle.sql.converter.CharacterConverters.toUnicodeChars([BI[CII)I
[/B]

Any thing i have to change?
Re: Inserting More than 32,000 Characters to NCLOB field [message #390635 is a reply to message #390627] Mon, 09 March 2009 01:48 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
How come you had an old jdbc?
Did you not upgrade your complete OAS?
Re: Inserting More than 32,000 Characters to NCLOB field [message #390638 is a reply to message #390635] Mon, 09 March 2009 01:56 Go to previous message
chandruthala
Messages: 5
Registered: March 2009
Location: INDIA
Junior Member

http://otndnld.oracle.co.jp/document/products/as10g/101310/doc_cd/integrate.1013/b28994/app_trblshoot.htm#CIHGDHFI

I came to know that this error is common with the jdbc driver 10.1.* The issue with the setString() command is resolved in jdbc driver 10.2.*.

http://jira.atlassian.com/browse/CONF-2919?focusedCommentId=117263#action_117263

I checked the jdbc driver used in oc4j. Its using the old JDBC drivers. So I have downloaded the latest JDBC 10.2.* driver jar files and added shared library in OC4J.
Previous Topic: i add adetional hard to my DB
Next Topic: How to find the Range
Goto Forum:
  


Current Time: Tue Feb 18 14:25:58 CST 2025