pvbcharon has asked for the wisdom of the Perl Monks concerning the following question:
Revered monks,
I come to you in a time of great need. I've inherited a web application running on Apache on a Windows server. It uses DBD::ODBC to connect to a Microsoft SQL Server.
I'm now working on transitioning the thing over to a Linux machine using FreeTDS through DBD::ODBC.
The problem I'm facing is that there seems to be a difference in implementation which boils down to this:
#!/usr/bin/perl use strict; use warnings; use DBI; our $db = DBI->connect('dbi:ODBC:DATABASE', 'USER', 'PASSWORD', { RaiseError => 1, AutoCommit => 1 } ); my $test=$db->prepare("select getdate()") or die($!); $test->execute(); print $test->fetchrow_array(); my $test2=$db->prepare("select getdate()") or die($!); $test2->execute(); print $test2->fetchrow_array();
On the Windows system I get the expected output (the date twice). On the Linux machine I get:
DBD::ODBC::st execute failed: unixODBCFreeTDSSQL ServerInvalid cursor state (SQL-24000) at testpm.cgi line 17.
twice. Line 17 is the second execute line. I get the output from the first statement but the script dies when reaching the second execute.
Now, for me this boils down to two questions:
Thanks for your time.
Dennis
|
|---|