Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxxAPC, How to unsubscrube from dategen spam, WWWXXXAPC, docmd.close 2585, WWWXXXDOCO, nu vot, dhcpd lease file "binding state", WWWXXXDOCO, how to setup procmail to process html2text, how to setup procmail html2text

Links

XODOX
Impressum

#1: Problem using column_info method and mysql

Posted on 2008-04-18 16:24:30 by denis

Hello,

I try to fetch column information from a mysql database, but I got the
following error :

DBD::mysql::db column_info failed: Incorrect database name '' at
../indexes.pl line 17.

Here is the code I use :

#!/usr/bin/perl

use warnings;
use DBI;
use strict;

my $dsn='DBI:mysql:xxx:xxx';
my $dbh= DBI->connect($dsn,"xxx","xxx") or die "Unable to connect to
database ($DBI::errstr)";

my $sth=$dbh->table_info('','','%','');

while (my @row = $sth->fetchrow_array) {
my $sth2=$dbh->column_info('',$row[1],$row[2],'%');
while (my @row2 = $sth2->fetchrow_array) {
print "@row2";
}
}

I try several things on the column_info(), nothing worked, and I found
nothing on the mailing list.

What do I make wrong ?

I use mysql 5.0.45-1ubuntu3.3 and libdbi-perl 1.57-1 both in the ubuntu
repositories.

Thanks in advance

Best regards

Denis Sacchet

--
Denis Sacchet aka. Ouba ("`-/")_.-'"``-._
. . `; -._ )-;-,_`)
"Computers are like air conditionners (v_,)' _ )`-.\ ``-'
They stop working properly when you _.- _..-_/ / ((.'
open Windows !!!" ((,.-' ((,/

Report this message

#2: Re: Problem using column_info method and mysql

Posted on 2008-04-19 02:42:03 by mgainty

Be sure to specify the $databasemy $dsn='DBI:mysql:$database';Bon
ChanceMartin------ Original Message -----
From: "Denis Sacchet" <denis@sacchet.fr>
To: <dbi-users@perl.org>
Sent: Friday, April 18, 2008 10:24 AM
Subject: Problem using column_info method and mysql


> Hello,
>
> I try to fetch column information from a mysql database, but I got the
> following error :
>
> DBD::mysql::db column_info failed: Incorrect database name '' at
> ./indexes.pl line 17.
>
> Here is the code I use :
>
> #!/usr/bin/perl
>
> use warnings;
> use DBI;
> use strict;
>
> my $dsn='DBI:mysql:xxx:xxx';
> my $dbh= DBI->connect($dsn,"xxx","xxx") or die "Unable to connect to
> database ($DBI::errstr)";
>
> my $sth=$dbh->table_info('','','%','');
>
> while (my @row = $sth->fetchrow_array) {
> my $sth2=$dbh->column_info('',$row[1],$row[2],'%');
> while (my @row2 = $sth2->fetchrow_array) {
> print "@row2";
> }
> }
>
> I try several things on the column_info(), nothing worked, and I found
> nothing on the mailing list.
>
> What do I make wrong ?
>
> I use mysql 5.0.45-1ubuntu3.3 and libdbi-perl 1.57-1 both in the ubuntu
> repositories.
>
> Thanks in advance
>
> Best regards
>
> Denis Sacchet
>
> --
> Denis Sacchet aka. Ouba ("`-/")_.-'"``-._
> . . `; -._ )-;-,_`)
> "Computers are like air conditionners (v_,)' _ )`-.\ ``-'
> They stop working properly when you _.- _..-_/ / ((.'
> open Windows !!!" ((,.-' ((,/
>

Report this message