Web Development
5 replies
by tg_willis
You can do. You could probably store it in a big varchar field(XML is just text right?) Some of the problems you might run into are with characters that potentially interfere with SQL syntax like quotes etc... So you may need to do a little experimenting to come up with an algorithm to process the xml replacing those characters in the XML with those that do not interfere with the SQL syntax. Of course, depending on how you process the xml when storing, you may have to reverse it before you loadit into a DOM.
If I could offer another suggestion, you may want to look at what benefits you expect from having XML stored in the DB. I went down the same path for a project and I came to the conclusion that having XML stored in a column in a DBsounds cool, probably looks cool on a resume, but doesn't really offer any benefits other than securing the XML under the same scheme that the DB is secured. Other than that, doing so may bring about other challenges.
Hope this helps, let me know if you need more clarification.
Tom Willis
by gckirksey
by tg_willis
I don't know how to post a comment as the site suggests. So, I'll just post another answer.
If the XML file is going to be too big for the Varchar field to handle(which wasn't mentioned in the question) then, I would guess it is not possible to insert it with straight SQL due the limitations on the driver on the client side. I could be wrong.
It sounds like you have a hard requirement to deal with. I'd be curious to know if anyone else has had this problem and what they did to solve it.
by gckirksey
by gckirksey
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending