Salutations all, I'm working on a Perl script to migrate data through
ODBC from a series of tables on one DBMS to a single table on a
separate DBMS, with access connections defined in the ODBC Sources
Win32 control panel applet.
It works fine on my computer and a co-worker's computer, which both
run Windows XP. However, on the client's computer which runs Windows
2000, it gives an ODBC error. All three setups use MS SQL 2000 and
ActiveState Perl 5.8.8. The operating system is the only difference,
and why it could be the source of the problem I don't know.
On Windows 2000 I get:
DBD:ODBC::st fetchrow_arrayref failed: [Microsoft][ODBC SQL Server
Driver] String data, right truncation (SQL-01004)(DBD: st_fetch/
SQLFetch (long truncated DBI attribute LongTruncOK not set and/or
LongReadLen too small) err=-1)
I searched online for the error and all I could find was that this
should work:
$dbh->{LongReadLen} = 16384;
$dbh->{LongTruncOk} = 1;
I tried this, and it does not impair the functionality on the XP
systems but it does not resolve the problem. I also did some analysis
on the data, and found that the source DB has data that is 100 or 200
characters (nvarchar) and the target DB takes 255 characters of
nvarchar. The largest piece of data is 80 characters, so there really
shouldn't be any truncation problem to begin with. Any help would be
greatly appreciated, as its been weeks of no leads or success and I'm
going insane. Thanks again.