in reply to FreeTDS (Linux) vs. SQLSRV32.dll (Windows) via ODBC
I haven't worked with it for a few years, but I did a lot of stuff that used FreeTDS to talk to SQL Server a while back, and I was never able to get it to work with multiple active statements on a single connection. I would always end up with the same "Invalid cursor state" error you're seeing.
We researched the issue pretty extensively and were unable to find a workaround, FreeTDS was missing support for the cursor types needed to make this possible. I'm guessing that this is still the case. As others have said, you'll either need to keep calling fetchrow_whatever until it returns undef or use the finish method to wrap up the current statement before you fire off another. That, or you could always open up a second connection.
Also, watch out for NULL (\0) characters at the end of strings returned from your queries. We started seeing that come out of DBI::ODBC + FreeTDS when we moved up to SQL Server 2005.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: FreeTDS (Linux) vs. SQLSRV32.dll (Windows) via ODBC
by mje (Curate) on May 28, 2010 at 11:01 UTC | |
by coldguy (Sexton) on Jun 01, 2010 at 22:16 UTC |