in reply to module & MSSQL driver recommendations for linux
Would you mind telling us what version of MS SQL Server you have, showing us the schema for the table you are inserting to and a small bit of Perl code which fails.
I maintain DBD::ODBC and use various drivers which happily insert into binary columns. In fact the DBD::ODBC test suite contains tests which do that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: module & MSSQL driver recommendations for linux
by ksublondie (Friar) on Sep 19, 2012 at 19:19 UTC | |
I've tried this in multiple tables and multiple dbs, all on the same sql server, using a modified version of the code from the DBD::Sybase documentation. One of my attempts is shown in the node referenced in my OP: sql2008 Filestream. The current table configuration in this example has col 1 varchar(40), col 2 datetime, col 3 uniqueidentifier, col 4 varchar(50), and col 5 varbinary(MAX) where col 5 is the column I'm trying to use as the blob column. My latest attempt is on a different db, same server, into col 7 where the table is as follows: col 1 int, col 2, int, col 3 varchar(50), col 4 money, col 5 varchar(20), col 6 bit, col 7 image, col 8 varchar(MAX).
(Forgive the obvious sql injection problems. I plan on fixing this once I can get the d@mned thing to work!) In all my attempts so far, I get the identical error as I posted in sql2008 Filestream and with the poster in inserting images in ms sql server.
I've been able to successfully insert/update blobs from windows scripts to this server on the same tables, but haven't had any luck with the FreeTDS/mssql combination. Pray tell, WHICH drivers work? | [reply] [d/l] [select] |
by mje (Curate) on Sep 20, 2012 at 08:11 UTC | |
DBD::ODBC works for me with the MS SQL Server ODBC Driver (Windows), the MS SQL Server Native Client (Windows) and the Easysoft SQL Server ODBC Driver (Linux).
Output
It did not work with the freeTDS driver I have (I've no idea why). It produced Error converting characters into server's character set. Some character(s) could not be converted (SQL-HY000) at pm_994504.pl line 35, <$f> line 1. BTW, just so you know, I maintain DBD::ODBC and I also work for Easysoft. UPDATE: the second insert was not using $binary and similary with the test at the end. | [reply] [d/l] [select] |
by ksublondie (Friar) on Sep 20, 2012 at 15:18 UTC | |
Thanks for the driver recommendation! I'll try that combination and hopefully get it to work. | [reply] |