annotate Doc/lib/sqlite3/execsql_printall_1.py @ 38197:204ec383b445 legacy-trunk

Text files missing the SVN eol-style property.
author Tim Peters <tim.peters@gmail.com>
date Tue, 16 May 2006 23:24:08 +0000
parents cf19a123a5d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38197
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
1 import sqlite3
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
2
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
3 # Create a connection to the database file "mydb":
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
4 con = sqlite3.connect("mydb")
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
5
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
6 # Get a Cursor object that operates in the context of Connection con:
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
7 cur = con.cursor()
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
8
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
9 # Execute the SELECT statement:
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
10 cur.execute("select * from people order by age")
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
11
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
12 # Retrieve all rows as a sequence and print that sequence:
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38069
diff changeset
13 print cur.fetchall()