0

I am new to python and currently working on an project where i need to download an xml file from webservice and then storing it locally on a shared drive, also i need to load the contents of this xml into a oracle db table.

I am done with downloading the url and saving it locally but i am finding it difficult to convert it into a sql file or a csv file which then can be loaded to the db.

Also i think there is an alternative way by calling the procedure to load this xml data to the table but since i do not have sufficient privileges on the db,using this local xml file is proving to be a hassle.

If anyone has a way of converting this xml file to sql or csv , please help

Egyptian
  • 63
  • 1
  • 3
  • 9
  • 1
    You can do the downloading and loading directly from Oracle, alternatively, you can parse the XML in Python and load directly into the database. Why do you need to convert this to a csv? – Ben Jun 26 '13 at 10:12
  • Indeed, I don't see why exactly converting into csv would solve your problem... – Emmanuel Jun 26 '13 at 10:31
  • csv was just an option,so i am free to other approaches as well. @ben ..could you please elaborate a little further for xml parsing in python.. – Egyptian Jun 26 '13 at 11:06
  • For parsing XML see [this question](http://stackoverflow.com/questions/1912434/how-do-i-parse-xml-in-python), for connecting to Oracle [see this one](http://stackoverflow.com/questions/7465889/cx-oracle-and-exception-handling-good-practices/9853319#9853319) (and many others on both counts). – Ben Jun 26 '13 at 19:10

0 Answers0