Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Answer: How do I dump a database table into XML format?

( #7595=categorized answer: print w/ replies, xml ) Need Help??

Q&A > database programming > How do I dump a database table into XML format? contributed by btrott

There's a module on CPAN designed exactly for this: DBIx::XML_RDB. You give it a SQL statement, and it executes the statement and dumps the returned rows and columns out in XML:
use DBIx::XML_RDB; my $xmlout = DBIx::XML_RDB->new($datasource, "ODBC", $userid, $password, $dbname) or die "Failed to make new xmlout"; # tell DBIx::XML_RDB which data it should retrieve # (by using a SELECT statement) $xmlout->DoSql("select id, name from foo"); # write out the data in XML format print $xmlout->GetData;
The module installs two utility scripts: sql2xml dumps SQL rows into XML, and xml2sql does the opposite.

Comment on Answer: How do I dump a database table into XML format?
Download Code
Replies are listed 'Best First'.
Re: Answer: How do I dump a database table into XML format?
by NodeReaper (Curate) on Feb 21, 2003 at 04:57 UTC

    Reason: dws Keyboard drool. Delete.

    For more information on this node visit: this

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2015-07-08 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls