source: trunk/essentials/dev-lang/python/Doc/lib/sqlite3/rowclass.py

Last change on this file was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 311 bytes
Line 
1import sqlite3
2
3con = sqlite3.connect("mydb")
4con.row_factory = sqlite3.Row
5
6cur = con.cursor()
7cur.execute("select name_last, age from people")
8for row in cur:
9 assert row[0] == row["name_last"]
10 assert row["name_last"] == row["nAmE_lAsT"]
11 assert row[1] == row["age"]
12 assert row[1] == row["AgE"]
Note: See TracBrowser for help on using the repository browser.