Hello,
I would appreciate your help with the following question.
I'm using DBD::ODBC to connect to a pervasive database. There is a column
in the table that is defined as LONGVARCHAR - 31999 bytes.
The fetch statement on the column fails with the following error
[Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine
Interface]Data truncated column 1. (SQL-01004)
[Pervasive][ODBC Client Interface]Data truncated column 1. (SQL-01004)
I set LongReadLen to 31999 and LongTruncOk to False to resolve the issue.
I don't get an error now, but the data is getting truncated to 80
characters.
Is there an issue with the Pervasive ODBC driver not supporting
LongReadLen?
my $sql_col1;
$dbh->{LongReadLen} = 31999;
$dbh->{LongTruncOk} = False;
print $dbh->{LongReadLen};
if ( !$sth->bind_columns( undef, \$sql_col1 ) ) {
print $LOG_FH
"Error encountered when binding columns in SQL statement $sql_to_run -
$DBI::errstr\n";
$rc = 1;
return ( $rc, \@db_records );
}
my $reccount = 0;
while ( $sth->fetch ) {
#Remove trailing spaces
$sql_col1 =~ s/\s+$//;
$db_records[$reccount] = $sql_col1;
$reccount++;
}
Thanks,
Saraswathi