Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

String literal too long for CLOB

937454Nov 8 2012 — edited Apr 25 2013
Hi,
My database version is:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

When I run this piece of code, I get an error.
DECLARE
insCtx DBMS_XMLStore.ctxType;
rows NUMBER;
xmlDoc CLOB := 'xml string is approx 4600 lines long in TOAD...........................';
BEGIN
insCtx := DBMS_XMLStore.newContext ('xmlTempTbl'); -- get the context
rows := DBMS_XMLStore.insertXML (insCtx, xmlDoc); -- insert the doc
DBMS_XMLStore.closeContext (insCtx); -- close the handle
END;

ERROR:
ORA-06550: line 4, column 19:
PLS-00172: string literal too long

From my understanding a CLOB can take maximum 2GB size string. And from above, my xml string is not greater than 2gb (I cannot post the xml string data, refers to business). Then why am I getting the string literal too long error.
For the above, I have to breakdown the xml into several parts and run the PLSQL, then it does not give any error.
Please advice.

Edited by: 934451 on Nov 8, 2012 7:06 AM

Edited by: 934451 on Nov 8, 2012 7:07 AM
This post has been answered by odie_63 on Nov 8 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2013
Added on Nov 8 2012
6 comments
31,811 views