Home » SQL & PL/SQL » SQL & PL/SQL » xml convertion
xml convertion [message #205803] Mon, 27 November 2006 11:57 Go to next message
angal_in
Messages: 12
Registered: July 2005
Location: chennai
Junior Member
hi my senario is

i have a csv file as below

name,age,sex
raja,22,male
mani,25,male

for each column value the attribute and element is given in a table as below

label_name,attribute, element
name identity clientname
sex identity client sex
age life_identity lifespan
and etc

now i have to read the csv file and convert it to xml using the attribute table as below

<response>
<identity clientname = "raja" client sex="male" />
<life_identity lifespan = "22"/>
</response>

like way i have to create the xml form for all the record in the csv and write it in an xml file.

could you pls suggest a good way to do this.

Regards
Angal
Re: xml convertion [message #205804 is a reply to message #205803] Mon, 27 November 2006 12:29 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
To load the csv into a table, you can use utl_file, sqlloader or "external tables". Do a search on each of those. Once loaded, you can use dbms_xmlgen.getxml to create the xml.

http://awads.net/wp/2005/12/19/producing-xml-from-sql-using-cursor-expressions/
Previous Topic: Thumb Rule.
Next Topic: Oracle Advanced Message Service - JMS - OpenJMS
Goto Forum:
  


Current Time: Sat Dec 03 07:48:23 CST 2016

Total time taken to generate the page: 0.06631 seconds