~malept/ubuntu/lucid/python2.6/dev-dependency-fix

« back to all changes in this revision

Viewing changes to Doc/includes/sqlite3/execsql_printall_1.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-13 12:51:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090213125100-uufgcb9yeqzujpqw
Tags: upstream-2.6.1
ImportĀ upstreamĀ versionĀ 2.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import sqlite3
 
2
 
 
3
# Create a connection to the database file "mydb":
 
4
con = sqlite3.connect("mydb")
 
5
 
 
6
# Get a Cursor object that operates in the context of Connection con:
 
7
cur = con.cursor()
 
8
 
 
9
# Execute the SELECT statement:
 
10
cur.execute("select * from people order by age")
 
11
 
 
12
# Retrieve all rows as a sequence and print that sequence:
 
13
print cur.fetchall()