source: python/trunk/Doc/includes/sqlite3/execute_1.py

Last change on this file was 391, checked in by dmik, 11 years ago

python: Merge vendor 2.7.6 to trunk.

  • Property svn:eol-style set to native
File size: 385 bytes
Line 
1import sqlite3
2
3con = sqlite3.connect(":memory:")
4cur = con.cursor()
5cur.execute("create table people (name_last, age)")
6
7who = "Yeltsin"
8age = 72
9
10# This is the qmark style:
11cur.execute("insert into people values (?, ?)", (who, age))
12
13# And this is the named style:
14cur.execute("select * from people where name_last=:who and age=:age", {"who": who, "age": age})
15
16print cur.fetchone()
Note: See TracBrowser for help on using the repository browser.