Skip to Content.
Sympa Menu

freetds - Re: [freetds] freetds - invalid cursor state

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: <jezekj AT centrum.cz>
  • To: <jklowden AT freetds.org>, FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] freetds - invalid cursor state
  • Date: Fri, 26 Feb 2016 20:26:07 +0100

Hello James,
 
so let me describe whole story again.
 
we have stored procedure:
create procedure test_me as
select getdate()
print test
select getdate()
 
Then we have piece of perl:
my $query = 'exec testproc';
my $sth = $dbh->prepare($query);
$sth->execute || die "Error running query $query";
while ( my $d = $sth->fetchrow_arrayref ) {
print Dumper $d; #should return first getdate()
}
while ( my $d = $sth->fetchrow_arrayref ) {
print Dumper $d; #should return second getdate()}
 
Perl is connecting through DBD::ODBC version 1.45
then we have unixODBC ( 2.3.1 ) as odbc manager, we also tried version 2.3.4
and we have both:
FreeTDS 0.91.dev.20110409RC1 (also tried FreeTDS 0.95.81), Easysoft (don't
know version)
 
 
When we use easysoft driver the result set contains date, then printed text
"test" and another result set contains another date.
When we use FreeTDS driver result set contains:
date
printed out 'test'
followed by invalid cursor state error.
 
When we do not fetch the second result set no error is thrown.
 
Sorry, but I have no idea how to understand ODBC logs.
 
Jakub
 
______________________________________________________________
Od: "James K. Lowden" <james.k.lowden AT icloud.com>
Komu: <freetds AT lists.ibiblio.org>
Datum: 26.02.2016 20:00
Předmět: Re: [freetds] freetds - invalid cursor state

On Thu, 25 Feb 2016 21:17:15 +0100
<jezekj AT centrum.cz> wrote:

Both are attached. I would really apreciate if you can take a look at
these logs and try to identify the root cause.

Perhaps I'm missing something, but to me it looks like a contradiction.
In the FreeTDS log, we see,
[ODBC][21590][1456398626.473093][SQLError.c][389]
               Exit:[SQL_SUCCESS]
                       SQLState = 24000
                       Native = 0x7fff2ad0ec58 -> 0
                       Message Text = [[FreeTDS][SQL Server]Invalid
cursor state]


SQL_SUCCESS is not an error, so "Invalid cursor state" cannot describe
the state.  Either the operation succeeded, or it failed because of an
invalid cursor state.  

--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
<http://lists.ibiblio.org/mailman/listinfo/freetds>





Archive powered by MHonArc 2.6.24.

Top of Page