String literal too long for CLOB
937454Nov 8 2012 — edited Apr 25 2013Hi,
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