I have this code where I am executing a select sql statement from python code using cx_oracle package:
import cx_Oracle
try:
cur = conn.cursor()
result = cur.execute('select * from table1')
print(str(cur.rowcount))
print(cur.fetchall())
except Exception as e:
print(e)
When I execute the above code I see 0 coming in for cur.rowcount but I see following data getting printed for cur.fetchall():
[('185',), ('1860',), ('1908',)]
cx_Oracle package documentation does mention Cursor.rowcount as a valid operation so I am not sure why in my code it is returning 0 even though the data is coming?
print(str(cur.rowcount))afterprint(cur.fetchall())?