I'm a newbie in Python
I'm debugging an existing script which is as follows,
print "Table name: %s " %table_name_r
print "Between: %s " % between
cursor = db.cursor()
print "Total Rows: %s " % cursor.rowcount
cursor.execute("""select contactid,li_url_clean,li_company,complink from """+ table_name_r +""" where li_company is not null and id_auto between """+between)
print "Execution complete"
I'm getting the below output,
Table name: li_records
Between: 4 and 6
Total Rows: -1
I have 2 questions here,
1.) (Resolved) My table li_records have 91 rows in it then why I'm getting the rowcount as -1?
2.) Why my script hangs up on cursor.execute?
Question 1 resolved: Like many of you pointed out the reason I'm getting '-1' is because I have not executed the query yet
Any help is appreciated. Thanks in advance.