dbms_xmlgen.XMLAgg() error - maximum length?
396312Jun 12 2003 — edited Jun 13 2003Hi All,
I'm attempting to return a create a large XML document using SQLX, and return it into a CLOB. I use XMLAgg to aggregate the XML generated by XMLElement. There appears to be a size limit that XMLAgg can handle. When the returned XML is more than 4000 characters (I'm guessing it uses a varchar2(4000), it blows up with an ORA-00600 error. If it's less than 4000 characters it works as expected. Unfortunately, 4000 characters of XML isn't much - I'm trying to generate a document of 150,000 - 900,000 characters.
I see no mention of a size restriction in the XML Database Developer's Guide (A96620-02), and I don't even find the XMLAgg function in the XML API Reference (A96616-01).
I'm currently on 9.2.0.1.0 (getting metalink account to upgrade), on a Windows 2000 platform.
So, some questions:
1) Is this expected behavior?
2) Can it handle more than 4000 characters in 9.2.0.3.0?
3) Is there a better way to create large XML documents that are a combination of elements and attributes (note: below script is a simplied version - my XML needs to be fairly complex)?
Here's a script demonstrating the problem. Please replace "field.fieldId" and "field.fieldname" with columns from a table large enough to generate a > 4000 character response.
Thanks,
Brian
select to_clob(XmlAgg(
XMLElement("test",
XMLElement("field", XMLAttributes(field.fieldid as "fieldId", field.fieldname as "fieldName")
)
)
)
)
as "xml"
from field;