annotate Doc/lib/sqlite3/execute_2.py @ 39496:352ffe77b71d legacy-trunk

Patch #1535500: fix segfault in BZ2File.writelines and make sure it raises the correct exceptions.
author Georg Brandl <georg@python.org>
date Mon, 14 Aug 2006 21:42:55 +0000
parents 204ec383b445
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: 38096
diff changeset
1 import sqlite3
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
2
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
3 con = sqlite3.connect("mydb")
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
4
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
5 cur = con.cursor()
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
6
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
7 who = "Yeltsin"
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
8 age = 72
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
9
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
10 cur.execute("select name_last, age from people where name_last=:who and age=:age",
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
11 {"who": who, "age": age})
204ec383b445 Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents: 38096
diff changeset
12 print cur.fetchone()