Dear Monks,
here's what I am trying to do:
I'm running a MySQL database and a socket server script. Clients may connect to this server and send it data in an XML format. The socket server receives the XML and inserts the data contained in it in the right tables and columns in the database (I'm using DBI and XML::Twig). OK, so far so good - I got this to work.
Now, I want clients to be able to send queries to the socket server (these would essentially be SELECT statements though how these are wrapped up is still up in the air), the server retrieves whatever it is the client wants and sends that back, wrapped up
in the same valid XML format as the data submissions come in. So that's the tricky bit. For now the results are sent back in generic
<resultset><row/></resultset> tags but that's no good. I have looked into various modules (DBIx::XMLMessage, XML::XMLtoDBMS, I think there are others but I haven't looked into them) but I'm not sure which one to use. My understanding of DBIx::XMLMessage is that you have to define what kind of queries might be performed beforehand in various templates. I'm not sure if this is flexible enough. I like the mapping system for XML::XMLtoDBMS, but, again, I'm not sure how flexible the queries can be.
What I'm looking for is a way of doing this that would allow fairly complex queries joining multiple tables to be executed and the results to appear automagically in the proper nesting structure. Obviously, not every possible SQL query under the sun could be wrapped in the XML data format we're using (e.g. "DESCRIBE ..." and that sort of thing wouldn't be possible) so there's some limit to what can be retrieved this way, but I'm looking for something that goes at least a bit further than cases like
SELECT employeename FROM employee WHERE emplyoeeID='34534'.
Please share your experiences with this kind of setup (it doesn't seem to be a hugely esoteric thing to do) so I can make an informed decision before I dive into something that may not do what I'm looking for.
Oh, I know this is a fairly vague and general question, sorry about that. I am still exploring how best to set set this system up so I'm looking for general suggestions for XML<=>DBMS, pros and cons.
Thanks.
In reply to DBMS<=>XML
by rvosa
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.