Home » SQL & PL/SQL » SQL & PL/SQL » ORA-01704: string literal too long in lob columns (Oracle,10g,Linux)
ORA-01704: string literal too long in lob columns [message #392240] Tue, 17 March 2009 02:25 Go to next message
Messages: 235
Registered: October 2007
Location: Chennai
Senior Member
Hi all,

I have insert records into table with clob columns. i am getting ORA-01704: string literal too long error while inserting records into table.
After that, i have inserted these records into table with empty_clob() into clob columns.

The clob records are assigned to one variable with clob datatypes and updated to row using pl/sql block.

the scripts has been attached for your references.

Is any possible to clob records inserting using insert scripts
  • Attachment: scr_clob.sql
    (Size: 9.42KB, Downloaded 1064 times)

[Updated on: Tue, 17 March 2009 02:30]

Report message to a moderator

Re: ORA-01704: string literal too long in lob columns [message #392246 is a reply to message #392240] Tue, 17 March 2009 03:08 Go to previous message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
In SQL there is a 4000 chr limit to a varchar2.
Anything enclosed by quotes is, by default, treated as a varchar2.

Split your XML into 4000 chr chunks, , wrap each chunk in a call to TO_CLOB(...), and concatenate these clobs.

Also - consider storing XML in am XMLTYPE column.
Previous Topic: Error while compliling the code
Next Topic: Sorting Problem while generating table dynamically ?
Goto Forum:

Current Time: Wed Aug 23 09:05:18 CDT 2017

Total time taken to generate the page: 0.09825 seconds