The following code executes perfectly well in my program. In this context I end up with an XML file that contains a tag with the contents “a very very very long string”.
DECLARE
doc_ dbms_xmlDom.DomDocument := := Dbms_XmlDom.newDomDocument;
nd_txt_ dbms_xmldom.DOMText;
text_content_ CLOB := 'a very very very long string';
BEGIN
--- blah blah blah, lots of code goes here...
nd_txt_ := Dbms_XmlDom.createTextNode (doc_, text_content_);
END;
But you will have noticed that I’ve defined my text_content_
variable as a CLOB
, not VARCHAR2
. What I’m doing in my real program is Base-64 encoding a PDF file and assigning that to text_content_
. The resulting base-64 string fits fine into the CLOB
, but breaks the 32k limit imposed by PL/SQL’s VARCHAR2
datatype. Since the function Dbms_XmlDom.createTextNode()
is defined with a VARCHAR2
datatype, at runtime I get an error saying that the character string buffer is too small.
Does Dbms_XmlDom
support tag-content >32k characters? And if so, how do I implement it?