ERROR:
sth->fetchrow_array fails with ODBC (DBD::ODBC) connection to SQL Server but
works fine with ORACLE using DBDOracle. See error below ...
DBD::ODBC::st fetchrow_array failed: [Microsoft][ODBC SQL Server Driver]String d
ata, right truncation (SQL-01004) at create_data_dump.pl line 267, <CFGFILE> lin
e 2.
DBD::ODBC::st fetchrow_array failed: [Microsoft][ODBC SQL Server Driver]String d
ata, right truncation (SQL-01004) at create_data_dump.pl line 267, <CFGFILE> lin
e 2.
CODE: (fetches a table row then writes each column of data separated by
delimiter)
while ( @table_row = $sth->fetchrow_array ) {
my $count = @table_row; # get number of columns
for ( my $counter = 0; $counter < $count; $counter = $counter + 1 ) {
if ( $counter == $count - 1 ) { # if last col then no field delimiter
if ( defined($table_row[$counter]) ) {
print DATFILE "\"$table_row[$counter]\"";
}
} elsif ( !defined($table_row[$counter]) ) { # if no col data then only
field delimiter
print DATFILE "$field_term";
} else { # otherwise, output col
and delimiter
print DATFILE "\"$table_row[$counter]\"$field_term";
}
} # end of for loop
print DATFILE "\n"; # when all cols outputted, print newline
} # end of inner while loop
#
# If verbose mode 'ON', then print to screen output info
#
if ( defined $opt{v} ) {
print STDOUT "Done.\n";
}
close (DATFILE);
} # end of outer while loop
Has anyone seen this error before?
Thx.