Nitin Niraj
Nitin Niraj

Reputation: 23

pyodbc rowcount return in negative

I am currently working on a python application which runs fine on 32 bit machine. Now I have to move to 64 bit . The problem which I am currently facing is the data from the database is not fetched properly here but If I run the same query on 32 bit machine it works. I am using pyodbc. When I fetch data I get -1 as my row count. I have installed IBM I series access odbc driver. I have installed that in C:\windows\SysWow64\odbcad32.exe but there is no luck. Can anyone explain me why I am getting as -1 in rowcount or what could be a possible reason for this. Thanks in advance.

Upvotes: 2

Views: 1164

Answers (1)

Faflok
Faflok

Reputation: 1143

As far as I know the -1 can occur if the number of rows is unknown. Sometimes its just because of performance reason - the number of rows is not known when the first row is returned, so it is not an error. More about this in podbc documentation here

Upvotes: 1

Related Questions