MySQL Forums
Forum List  »  Perl

Re: SQL to XML using DBIx::XML_RDB >> Can't connect to the database
Posted by: Bill Karwin
Date: June 20, 2006 11:50PM

lauragarcia_b wrote:
> my $xmlout = DBIx::XML_RDB->new($data_source,
> 'mysql', $mySqlUsername, $mySqlPassword
> {'RaiseError' => 1, 'PrintError' => 1});

A few comments on the above:

1. You don't have a comma between $mySqlPassword and the following hashref argument.

2. This DBIx::XML_RDB->new() function doesn't support a DBI-style connect option hashref anyway, based on reading the code at http://search.cpan.org/src/MSERGEANT/DBIx-XML_RDB-0.05/XML_RDB.pm

3. You aren't checking for this new() function returning undef, which it does if the connection fails. Since you're getting an error about undef when trying to use the $xmlout object, it is evidently having some problem connecting. Perhaps because of the hashref.

Regards,
Bill K.

Options: ReplyQuote


Subject
Written By
Posted
Re: SQL to XML using DBIx::XML_RDB >> Can't connect to the database
June 20, 2006 11:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.