Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: MS SQL problem

by disciple (Pilgrim)
on Dec 10, 2004 at 17:10 UTC ( [id://413914]=note: print w/replies, xml ) Need Help??


in reply to Re: MS SQL problem
in thread MS SQL problem

dragonchild is correct.

Funny thing is I was just reading about this last night in my "Programming the Perl DBI" book. It says if a statement handle is opened and has not been "finished" you will get the following warning when trying to reuse the statement handle: "disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on them before disconnecting)". If you are fetching from a statement handle and you fetch the last row, the finish method is called for you. On the other hand if you do not fetch all the rows and try to reuse the statement handle you get the following warning: "disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on them before disconnecting)".

What I didn't read in the book is this. If you attempt to reuse the database handle when a statement handle is open and not finished you get the error: "st execute failed: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt". This may only be the case with MS SQL, but I am not sure.

When I executed equivalent code you posted with warnings turned on, I got both the error you posted and the warning I posted.

Update: Put code tags around error message to fix output.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://413914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-28 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found