$dbh->{LongReadLen} = 50000; $dbh->{LongTruncOk} = 1; my $rv; my $cursor = $dbh->prepare($sqlstr) ; eval{ $cursor->execute(); }; if ( $@) { $cursor->finish; exitApp("Error in execSql $@", -1); } else { pen ("Successfully executed the query"); if ( length($colname) > 1) { my $row = $cursor->fetchrow_hashref; $rv = $row->{$colname}; pen("Got SQlRet:" . $rv); } # if colname } # if error $cursor->finish; #### $dbh->{LongTruncOk} = 0;