develooper Front page | perl.dbi.users | Postings from April 2008

Problem using column_info method and mysql

Thread Next
From:
Denis Sacchet
Date:
April 18, 2008 16:25
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 !!!"                        ((,.-'   ((,/

Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About