Relevant code:

27 my $sth1 = $dbh->prepare ( $q1 ); 28 my $sth2 = $dbh->prepare ( $q2 ); 29 30 print "INFO: If we got this far, we were able to create two \ statement handles.\n"; 31 32 $sth1->execute or 33 die ( "FATAL: Unable to execute q1: " . $sth1->errstr ); 34 $sth2->execute or 35 die ( "FATAL: Unable to execute q2: " . $sth1->errstr );
Here's the error:
INFO: If we got this far, we were able to create two statement handles +. DBD::ODBC::st execute failed: [FreeTDS][SQL Server]Invalid cursor stat +e (SQL-24000) at two_handles.pl line 34. FATAL: Unable to execute q2: [FreeTDS][SQL Server]Invalid cursor state + (SQL-24000) at two_handles.pl line 34. Issuing rollback() due to DESTROY without explicit disconnect() of DBD +::ODBC::db handle Driver=FreeTDS;ServerName=SqlServer;Database=FOOBAR + at two_handles.pl line 34.
So FreeTDS is reporting on an invalid cursor state .. but I don't know if it's FreeTDS' error, or if that's coming from DBD::ODBC. I may need to start spelunking.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.


In reply to Re^2: DBD::ODBC and FreeTDS / limited to one statement handle by talexb
in thread DBD::ODBC and FreeTDS / limited to one statement handle by talexb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.