LongReadLen not working with Pervasive

[email protected]
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <OF6ADD480F.745DCA48-ON85257A25.000ED3C6-85257A25.000F5FDE@lnotes-gw.ent.nwie.net>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.