I have this Oracle XML and I get an external XML parsing error because the
tag spans multiple lines:
set pages 0
set lines 150
set head off select dbms_xmlgen.getxml
* from (select no,subject where mykey=1)') xml from dual ;
123456789 123456789 123456789 123456789 123456789 12</SUBJ
As you see, the <SUBJECT> XML tag is spanning in two lines, and
so the output is invalid for external xml parser.
What is the line continuation character for
Oracle XML when using dbms_xmlgen?
Answer: There is no "continuation" character in native XML!!!
Normally, if you write an XML on several lines, leave whitespace,
123456789 123456789 123456789 123456789 12
However, you have dbms_xmlgen output executed from SQL*Plus, and the
line break is created by SQL*Plus, not dbms_xmlgen.
Rarely, there are cases of the error:
ORA-01706: User function result value was too large
But in your case, the SQL*Plus output is truncated to 77 characters.
Start by spooling the SQL*Plus output to a flat file and see if it
sqlplus -S system/manager << !
set pages 999
set lines 999
set long 9999
set head off spool
select dbms_xmlgen.getxml ('select * from (select no, subject where
mykey=1)') xml from dual ;
cat /tmp myfile.txt
It is also possible that your SQL*Plus output line length is not
long enough. Try going to 110 line using the following
set lines 110
If 110 is not long enough, you can try larger numbers.
If it is still truncating at 77 characters at this point, try the
following with 100 character SQL output:
select '123456789 123456789 123456789
123456789 123456789 123456789 123456789 1234567890 123456789
If this works for you with the XML package, it would appear that you
have hit a
bug with dbms_xmlgen.getxml.
You can check MOSC for more
Get the Complete
Oracle SQL Tuning Information
The landmark book
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
for 30% off directly from the publisher.