Re: freetds - invalid cursor state

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4cY3nkoA2-oZHrrKTkN6mVwTz1Eyg5QYzTu_v0F8dRvyw@mail.gmail.com>
I found the problem!
But you won't like it!
Easysoft is wrong!
Well... all other ODBC drivers (I tested FreeTDS, NCLI and NCLI10
which are Microsoft SQL Server 2005 and 2008) all behave the same
(returning 0 columns from SQLNumResultCols and "Invalid Cursor State"
from SQLFetch).
The main reason is that in ODBC 3 (ODBC 2 is obsolete since 20 years
or so) a record set can just contain the error with no rows. What you
are trying to do is getting rows while you have no rows. The fact that
easysoft join the error to next record set (which is more a ODBC 2
behaviour) is just different from the standard MSSQL (and FreeTDS)
drivers.
So the solution has to be searched in higher level (DBD::ODBC or your
program). Surely you can get all record sets using DBD::ODBC as is
tested really well with MSSQL using Microsoft drivers.

Frediano


2016-02-26 19:28 GMT+00:00  <[email protected]>:
> But no cursor is open since the begining. I know that some drivers are
> opening cursors implicitly, but me as a user I cannot do anything with this,
> or can I?
>
> When issue is solved and you are in Prague the beer is on me!
>
> JJ
>
> ______________________________________________________________
>>
>> Od: Frediano Ziglio <[email protected]>
>> Komu: FreeTDS Development Group <[email protected]>, "James K.
>> Lowden" <[email protected]>
>> Datum: 26.02.2016 20:23
>> Předmět: Re: [freetds] freetds - invalid cursor state
>>
> On 26 Feb 2016 19:00, "James K. Lowden" <[email protected]> wrote:
>>
>>
>> On Thu, 25 Feb 2016 21:17:15 +0100
>> <[email protected]> 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.
>>
>
> Well... time for a beer I think.
> However. Sql error returns the error string for previous function calls. So
> it succeeded (returned the error) and error was "Invalid cursor state"
>
> Frediano
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
> <http://lists.ibiblio.org/mailman/listinfo/freetds>
>
>
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.