Reputation: 31
I don't know whats wrong with the attached code, it throws an error error 'long' object has no attribute 'fetchall'. Can some one help me out please.
Code:
Upvotes: 0
Views: 1003
Reputation: 77952
cursor.execute()
returns an int telling how many rows where affected (=>selected, inserted, deleted, updated...) by the SQL query, so you cannot chain the .fetchall()
call, you need to do it in two steps:
x.execute("your query here")
rows = x.fetchall()
Upvotes: 0