Skip to Content.
Sympa Menu

freetds - Re: [freetds] Multiple queries

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Kasak <dkasak AT nusconsulting.com.au>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Multiple queries
  • Date: Tue, 10 Oct 2006 16:49:01 +1000

Conley Bone wrote:

I am using freetds 0.63 to access an MSSQL 2000 DB from a Perl script running on Linux.
I have been using Freetds in this scenario for several years with no problems until we upgraded the DB from 97 to 2000.
I have a bunch of scripts that have multiple queries. My normal procedure is to open the connection, prepare the queries, execute them, then loop through the results as I need them.
This worked fine with SQL97, but doesn't work in SQL2000. Only the first query is prepared, and I get an error on any subsequent query preparations unless I finish the first one before I prepare the next one.
Any ideas?

This has been the biggest thawn in my paw with the FreeTDS driver since I started using it. I'm using SQL Server 7. What I do is do an explicit $sth->finish after *everything*. I also open many database connections - ie don't open 2 recordsets simultaneously from the 1 connection. Obviously this strategy doesn't scale up particularly well, but it's fine on our LAN.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak AT nusconsulting.com.au
website: http://www.nusconsulting.com.au




Archive powered by MHonArc 2.6.24.

Top of Page