
1arryb
User
Aug 4, 2009, 8:25 AM
Post #4 of 9
(18884 views)
|
Re: [magix] Problem with perl DBI ODBC driver (bug or misconfig ?) [String data right truncation]
[In reply to]
|
Can't Post
|
|
Hi magix, Try it w/o the outer loop, which I don't think is necessary.
#!/usr/bin/perl use strict; use warnings; use DBI; # Define $dsnname, $dbuser, $dbpwd; ... my $dbh = DBI->connect('dbi:ODBC:' . $dsnname, $dbuser, $dbpwd) or ... $sth = $dbh->prepare($sql) or die... $sth->execute(); my $line = 1; # fetch and print each row in array while (my $row = $sth->fetchrow_arryref()) { print $line++, ": ", join(', ', @$row), "\n"; } Cheers, Larry
|