I'm trying to iterate through all the rows in a table named Throughput, but for a specific DeviceName (which I have stored in data['DeviceName']. I've tried the following, but it doesn't work:
for row in cursor.execute("SELECT * FROM Throughput WHERE DeviceName=%s"), %(data['DeviceName']):
EDIT: also tried this but it doesn't work:
for row in cursor.execute("SELECT * FROM Throughput WHERE(DeviceName), values(?)", (data['DeviceName']) ):
EDIT2: A snippet of my final working code:
query = "SELECT * FROM Throughput WHERE DeviceName = '%s'" % data['Device Name']
try:
for row in cursor.execute(query):