| | |
Problem with perl DBI ODBC driver (bug or misconfig ?) String data right truncation
Thread Solved |
•
•
Join Date: Aug 2009
Posts: 3
Reputation:
Solved Threads: 0
Problem with perl DBI ODBC driver (bug or misconfig ?) String data right truncation
0
#1 Aug 3rd, 2009
Hello,
I'm trying to simply do a SELECT from an ODBC source.
It works perfectly in PHP but not in perl !
Therefore there is no problem at source or at ODBC level, it seems to reside at perl/DBI level...
What I do :
But even if my script is working, most of the time (not always but 80% of time ???) I get this error :
DBD::ODBC::st fetchrow_array failed: [unixODBC][IBM][System i Access ODBC Driver]Column 1: CWB0111 - A buffer passed to a system call is too small to hold return data (SQL-22018) [state was 22018 now 01004]
[unixODBC][IBM][System i Access ODBC Driver]String data right
truncation. (SQL-01004) at ./odbcdemo-perl.pl line n.
I'm not an ODBC expert, not a DBI expert, therefore I'm maybe forgetting something important to be done, but I don't find anything on the web that helped me...
Last idea, could it be due to UTF8, which would create difference in
string sizes ?
I found a similar bug in PHP :
And a thread about my problem but without solution :
But I don't understand DBI enough to understand what I should do ?
Thanks a lot for any help !
Denis
I'm trying to simply do a SELECT from an ODBC source.
It works perfectly in PHP but not in perl !
Therefore there is no problem at source or at ODBC level, it seems to reside at perl/DBI level...
What I do :
Perl Syntax (Toggle Plain Text)
use DBI; $dbh = DBI->connect('dbi:ODBC:' . $dsnname, $dbuser, $dbpwd) or... $sth = $dbh->prepare($sql) or die... do { my @row; my $line=1; # fetch each row in array while (@row = $sth->fetchrow_array()) { print ($line + 1); print ". "; # print each field in a row for ($i=0;$i<$#row;$i++) { print $row[$i] }; print "\n"; $line++; } # see if there's more records to show } while ($sth->{odbc_more_results});
But even if my script is working, most of the time (not always but 80% of time ???) I get this error :
DBD::ODBC::st fetchrow_array failed: [unixODBC][IBM][System i Access ODBC Driver]Column 1: CWB0111 - A buffer passed to a system call is too small to hold return data (SQL-22018) [state was 22018 now 01004]
[unixODBC][IBM][System i Access ODBC Driver]String data right
truncation. (SQL-01004) at ./odbcdemo-perl.pl line n.
I'm not an ODBC expert, not a DBI expert, therefore I'm maybe forgetting something important to be done, but I don't find anything on the web that helped me...
Last idea, could it be due to UTF8, which would create difference in
string sizes ?
I found a similar bug in PHP :
And a thread about my problem but without solution :
But I don't understand DBI enough to understand what I should do ?
Thanks a lot for any help !
Denis
•
•
Join Date: Aug 2009
Posts: 3
Reputation:
Solved Threads: 0
Re: Problem with perl DBI ODBC driver (bug or misconfig ?) String data right truncation
0
#2 Aug 3rd, 2009
•
•
Join Date: Aug 2009
Posts: 3
Reputation:
Solved Threads: 0
Re: Problem with perl DBI ODBC driver (bug or misconfig ?) String data right truncation
0
#3 Aug 5th, 2009
Solution on :
http://groups.google.ch/group/perl.d...85cb9d0c0fc780
http://groups.google.ch/group/perl.d...85cb9d0c0fc780
![]() |
Similar Threads
- Unable to retrieve String data from Excel to SQL Server database (VB.NET)
- [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server 10060 (Visual Basic 4 / 5 / 6)
- Save string data to integer (PHP)
- Error java.sql.SQLException: [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle (Java)
- steps for installing ODBC driver (Oracle)
- about VC+MySQL problem:) (C)
- using jdbc-odbc driver (Java)
- Number input problem. (C++)
Other Threads in the Perl Forum
- Previous Thread: Mail::SPF::Query update: make test fails
- Next Thread: Basic Perl Web Upload Script
| Thread Tools | Search this Thread |





