|Subject:||Invalid precision value (SQL-HY104) error on inserts|
|Date:||Sat, 25 Sep 2010 19:31:49 +0200|
|To:||bug-DBD-ODBC [...] rt.cpan.org|
|From:||Petr Merta <mertap [...] upcmail.cz>|
Hi, I'd like to report what I believe is a bug in DBD::ODBC code, causing HY104 errors on varchar INSERTs when running against Microsoft SQL server. Working demo code is given as attachment, changing the connection string should be enough for making it run. The bug appeared when running on Windows (2k3, vista, win7), with various perl distributions and versions (Strawberry Perl both 32/64bit, ActivePerl, Cygwin). DBD::ODBC version primarily tested was 1.25, but the bug showed up also in 1.24 and 1.21. As for database environment, the bug seems rather independent of version of database server and client connectivity drivers. The sample code was tested against MS SQL Server 2K, 2k5, 2k8 and 2k8r2, with client drivers ranging from default win2k SQL server drivers to SQL Server Native Client 10. Interesting enough, the code works as expected when run on rather antique cygwin installation (1.5.25, perl 5.10.0, dbi 1.607, dbd::odbc 1.18). (complete detailed info on tested versions is also given in comments in the end of the sample code) There are two INSERTs in demo code. The first one is plain INSERT into one of the tables; it succeeds. The second INSERT is combined with SELECT from the other table, and this is the one which fails with HY104. Should you need any further information, please let me know. Regards, -- Petr Merta, firstname.lastname@example.org
Message body is not shown because sender requested not to inline it.