source: vendor/python/2.5/Doc/lib/sqlite3/execsql_printall_1.py

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

Python 2.5

File size: 350 bytes
Line 
1import sqlite3
2
3# Create a connection to the database file "mydb":
4con = sqlite3.connect("mydb")
5
6# Get a Cursor object that operates in the context of Connection con:
7cur = con.cursor()
8
9# Execute the SELECT statement:
10cur.execute("select * from people order by age")
11
12# Retrieve all rows as a sequence and print that sequence:
13print cur.fetchall()
Note: See TracBrowser for help on using the repository browser.