Home » SQL & PL/SQL » SQL & PL/SQL » wants to generate XML (oracle 9i)
wants to generate XML [message #670023] Wed, 30 May 2018 02:50 Go to next message
AyeshaSaad
Messages: 16
Registered: December 2016
Junior Member
Dear ALL
I want to generate XML from SQL, I have attached a sample file. Please check and guide me how?
  • Attachment: Sample.txt
    (Size: 0.42KB, Downloaded 338 times)
Re: wants to generate XML [message #670025 is a reply to message #670023] Wed, 30 May 2018 03:37 Go to previous messageGo to next message
Michel Cadot
Messages: 67303
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select '<?xml version="1.0" encoding="utf-8"?>
<DistributorStockOpenings>
	<MessageHeader>
	<MESSAGEID>6BE91FD6F7C929ACE05329C8A8C026DD</MESSAGEID>
	</MessageHeader>
<DistributorStock>
	<Distributor>608</Distributor>
	<StockDate>2018-03-05</StockDate>
	<Warehouse>01</Warehouse>
	<ProductID>110413</ProductID>
	<ProductType>N</ProductType>
	<BatchID>GKBCC</BatchID>
	<OpeningQuantity>353</OpeningQuantity>
</DistributorStock>'
from dual

From your previous topics:

AyeshaSaad wrote on Thu, 29 December 2016 09:45
Thanks Littlefoot, I will try and then update you.

Never updated.

No feedback.
No feedback.
No feedback.
No feedback.

BlackSwan wrote on Tue, 29 May 2018 15:32
...
Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read
Re: wants to generate XML [message #670040 is a reply to message #670025] Wed, 30 May 2018 12:26 Go to previous message
Bill B
Messages: 1968
Registered: December 2004
Senior Member
The following code will pump an entire table as XML. The output will be put into a CLOB

select dbms_xmlgen.getxml('select * from itm where rownum < 10') xml from dual;
Previous Topic: update huge table every n rows
Next Topic: error while removing ' using regex
Goto Forum:
  


Current Time: Fri Aug 14 06:42:50 CDT 2020