Perl DBI Issue With iSeries AS400 Returning Null Columns on 64-bit Linux
We’re having an issue with database queries to the iSeries AS400 through Perl using DBI and DBD::ODBC. The issue occurs when the SQL statement contains an outer join and the query returns rows with NULL columns:
my $sql_query = qq|select PRSK01, PSTA15
from TESTHA.POLMAST
left join TESTHA.P15POLDP
on POLC01 = PPOL15 where POLC01 = 003950136|;
# Execute the sql query
my $sth = $dbh->prepare( $sql_query )
or die $sql_query, "
\n", $DBI::errstr;
my $data = $dbh->selectall_arrayref( $sth, {Columns=>{}}, @sql_data )
or die $sql_query, "
\n", $sth->errstr;
The error returned is:
DBD::ODBC::db selectall_arrayref failed: st_fetch/SQLFetch (long truncated DBI attribute LongTruncOk not set and/or LongReadLen too small) (SQL-HY000)
Last Updated: Wed, 08 Aug 2012