source:
trunk/essentials/dev-lang/python/Doc/lib/sqlite3/execute_3.py
| Last change on this file was 3225, checked in by , 19 years ago | |
|---|---|
| File size: 211 bytes | |
| Line | |
|---|---|
| 1 | import sqlite3 |
| 2 | |
| 3 | con = sqlite3.connect("mydb") |
| 4 | |
| 5 | cur = con.cursor() |
| 6 | |
| 7 | who = "Yeltsin" |
| 8 | age = 72 |
| 9 | |
| 10 | cur.execute("select name_last, age from people where name_last=:who and age=:age", |
| 11 | locals()) |
| 12 | print cur.fetchone() |
Note:
See TracBrowser
for help on using the repository browser.
