Skip to Main Content

Database Software

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!

Remove <?xml version = '1.0'?>

968361Dec 17 2012 — edited Dec 18 2012
I have a requirement In which i have to wite XML o/p into file.
I have used the XMLelement function to create xml and then used Utl_file.put_raw to raw the data into file.
But the requirement was to write the output for more than 1,00,000 transactions. So i have to break the query and run a loop and to write each 10,000 records in one loop as i was running out of memory. The code is working fine but the tag <?xml version = '1.0'?> is comming after each 10,000 iteration i.e after next loop starts to process anothe bunch of 10,000 records <?xml version = '1.0'?> header again comes at the top so for 100,000 records the <?xml version = '1.0'?> is comming 10 times. As i am appending o/p of next iteration to the previous one.

it is like <?xml version = '1.0'?>
trans 1
.
.
.
trans 10,000
<?xml version = '1.0'?>
trans 1
.
.
. trans 10,000
<?xml version = '1.0'?>



My question is how can i remove <?xml version = '1.0'?> from my xml. i tried to convert my xmltype into clob and then apply the substr but it is giving me error XML parsing failed.

my oracle version is 10g.


It would be great if you could suggest any possible way to remove <?xml version = '1.0'?> from header.



Source code is

Edited by: 965358 on Dec 17, 2012 7:32 AM
This post has been answered by odie_63 on Dec 18 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2013
Added on Dec 17 2012
4 comments
961 views