-
-
Save anonymous/cf30c11fec8cb082deaa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
conn = sqlite3.connect('example.db') | |
conn.execute("CREATE TABLE tbl (id INTEGER PRIMARY KEY, someint INTEGER)"); | |
conn.execute("INSERT INTO tbl (id, someint) VALUES (1, 3)"); | |
conn.execute("INSERT INTO tbl (id, someint) VALUES (2, 4)"); | |
result = conn.execute('SELECT * FROM tbl'); | |
conn.execute('UPDATE tbl SET someint = 5 WHERE id = 1'); | |
conn.execute('UPDATE tbl SET someint = 6 WHERE id = 2'); | |
for item in result: | |
print item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment