Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

DBIx::XML_RDB

by mirod (Canon)
on Sep 01, 2000 at 16:20 UTC ( #30705=modulereview: print w/ replies, xml ) Need Help??

Item Description: Exports data from a relational data base as XML

Review Synopsis:

Description

DBIx::XML_RDB - Perl extension for creating XML from existing DBI datasources. DBIx::XML_RDB comes with the sql2xml tool which simply dumps a table in a database to an XML file.

Why use DBIx::XML_RDB?

  • you want to export the data base data in XML
  • you prefer to process the data using XML tools rather than as a table

Why NOT use DBIx::XML_RDB?

  • you are not using a DBI-supported data base!
  • you want to generate something more complex than just record oriented XML, with nested structures for sub-tables for example

Example

use DBIx-XML_RDB;
my $xmlout = DBIx::XML_RDB->new($datasource,
              "ODBC", $userid, $password, $dbname) || die "Failed to make new xmlout";
$xmlout->DoSql("select * from MyTable");
print $xmlout->GetData;

Personal Notes

I haven't used DBIx-XML_RDB too often (the first script I wrote with DBI did exactly the same thing!) but it looks like the right tool to generate XML out of a relational table

Comment on DBIx::XML_RDB
RE: DBIx::XML_RDB
by Anonymous Monk on Sep 01, 2000 at 21:07 UTC
    There seems to be a bug in MySQL which prevents it from working to read XML into the database. But it works fine to extract it.

    It also needs some maintainence, but I'm missing tuits.

    Matt.

      Matt, thanks for the heads up. I don't know if anyone else has noticed this problem or not.
      Have you checked MSQL's docs for discussions of this problem? Can you point me to a location that discusses that problem? Was there something Perl specific you wanted to ask, or does this relate to a Perl module you are working on?
      Generally we like to keep things related to Perl when we post, or else, there will be too much noise in our sig2noise ratio. ;)
      Cheers!

        Hum....
        Matt is actually the author of the module, so I guess he was not really asking a question...

      Thanks for the info and to everyone else who wrote in. r.b.
      Just an FYI, the MySQL issue has been worked around in the latest release of DBIx::XML_RDB (though the bug in MySQL may still exist). Also, this module now produces well-formed XML and properly encodes any > and < characters that may be in the SQL query when writing the output file.

      -ubu
Re: DBIx::XML_RDB
by DamnDirtyApe (Curate) on Aug 08, 2001 at 22:17 UTC
    I can't seem to get DBIx::XML_RDB to connect to an Oracle database... anyone else have this problem? DBI connects fine.

      Nice timing: DBIx::XML_RDB has just been replaced by XML::Generator::DBI, so you might want to give it a try in case this one works.

Back to Reviews

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: modulereview [id://30705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-08-23 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls