Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Saving XML document in DB  RSS feed

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking to save an XML document - really a DOM, not an actual file - in a SQL Server database. I've done lots of rummaging, and managed only to confuse myself (which doesn't take much). Any gentle, or not so gentle, nudges in the right direction would be greatly appreciated.

The closest I've been able to get is to convert the DOM to a string, and then write pass that thru a StringReader, and then finally insert it into the table, in an NText column, with .setCharacterStream. That gets some of the text from the DOM in, but not even close to all of it.

Thanks
 
author
Posts: 4105
23
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to save it as a Blob/Clob. Some databases like Oracle actually support XML as a datatype, although its really just a fancy Blob/Clob.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!