Reputation: 1191
How to take two values into sqlite3 ?
v1 = '2011.11.10'
v2 = 10
vv1=(v1,)
vv2=(v2,)
conn = sqlite3.connect('date.db')
c = conn.cursor()
c.execute(" UPDATE archive SET date=? WHERE Id=? ", (vv1,vv2) ) # (vv1,vv2) this is not work, how?
conn.commit()
I know, that probably a simple , but can't find anything on net. Tnx
Upvotes: 1
Views: 64
Reputation: 880259
v1 = '2011.11.10'
v2 = 10
...
c.execute(" UPDATE archive SET date=? WHERE Id=? ", (v1,v2) )
For cursor.execute
, pass a sequence of values, not a sequence of sequence of values.
For cursor.executemany
, in contrast, you would want to pass a sequence of sequences.
Upvotes: 1