Incomplete headers is a CGI problem, not a DBI problem. Try adding CGI::Carp as I show below so errors will print to the browser. Assuming you have created a *system* DSN for your database called MyDB, here's basic usage:
#!perl -w
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use DBI;
my $dbh = DBI->connect( 'dbi:ODBC:MyDB'
, $user
, $pass
, {RaiseError=>1}
);
my $sth = $dbh->prepare("SELECT * FROM foo");
$sth->execute;
print CGI::header();
while (my $row = $sth->fetch){
my @r = map { defined $_ ? $_ : '' } @$row;
print "@r<br>\n";
}
$dbh->disconnect;
|