My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 259: rowcount seems numerical overflow
1 person starred this issue and may be notified of changes. Back to list
Status:  Hold
Owner:  ----


 
Reported by chuangt...@gmail.com, May 8, 2012
What steps will reproduce the problem?

src_cnxn=pyodbc.connect(src_connectstring)
src_curs=src_cnxn.cursor()

checkresults_exe=src_curs.execute("locking row for access SELECT ITEM_ID, (count(*)(bigint))  AS count_audit FROM DBNAME1.TABLE1 WHERE  END_DT>=(('2011-01-01'(DATE))-interval '6' month)  GROUP BY ITEM_ID ORDER BY count_audit DESC")

checkresults_exe.rowcount  ##This returns a negative number

What is the expected output? What do you see instead?
The result should be a positive long integer, but it gives me a negative number.

What version of the product are you using? On what operating system?
pyodbc 3.0.3
python 2.7.2
teradata ODBC 64bit


Jun 26, 2012
Project Member #1 mkleehammer
If the value is always -1, it is probably the driver.  The rowcount value is supposed to be -1 when the previous statement was not one that modifies or selects rows.  Note that pyodbc does not examine the SQL - it simply calls SQLRowCount.

For example, if you execute a "create table ..." statement, the rowcount should be -1.

Is the value some other negative number?
Status: Hold
Jun 26, 2012
#2 chuangt...@gmail.com
The value depends on the number of rows in a table. If the number is less than one billion, it can correctly show the positive number. If the number is larger than a threshold, it shows a negative number, such as -49,186,683 records, -1,820,934,434 or  -1,799,086,733 records.

Powered by Google Project Hosting