User:Stefan/sqlite: Difference between revisions
Jump to navigation
Jump to search
(Created page with "This works in scribus scripter console ############### import sqlite3 con = sqlite3.connect('mydatabase.db') cur = con.cursor() # cur.execute('CREATE TABLE foo (o_id INTEGER ...") |
No edit summary |
||
Line 1: | Line 1: | ||
This works in scribus scripter console | This works in scribus scripter console | ||
<pre> | |||
############### | ############### | ||
Line 14: | Line 15: | ||
cur.execute('SELECT * FROM foo') | cur.execute('SELECT * FROM foo') | ||
print cur.fetchall() | print cur.fetchall() | ||
</pre> |
Revision as of 14:23, 22 June 2011
This works in scribus scripter console
############### import sqlite3 con = sqlite3.connect('mydatabase.db') cur = con.cursor() # cur.execute('CREATE TABLE foo (o_id INTEGER PRIMARY KEY, fruit VARCHAR(20), veges VARCHAR(30))') # con.commit() cur.execute('INSERT INTO foo (o_id, fruit, veges) VALUES(NULL, "apple", "broccoli")') con.commit() print cur.lastrowid cur.execute('SELECT * FROM foo') print cur.fetchall()