Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/sqlite3/executescript.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 | 6f6e55fd9b79 |
| 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 con = sqlite3.connect(":memory:") |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
4 cur = con.cursor() |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
5 cur.executescript(""" |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
6 create table person( |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
7 firstname, |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
8 lastname, |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
9 age |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
10 ); |
|
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 create table book( |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
13 title, |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
14 author, |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
15 published |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
16 ); |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
17 |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
18 insert into book(title, author, published) |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
19 values ( |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
20 'Dirk Gently''s Holistic Detective Agency |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
21 'Douglas Adams', |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
22 1987 |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
23 ); |
|
204ec383b445
Text files missing the SVN eol-style property.
Tim Peters <tim.peters@gmail.com>
parents:
38069
diff
changeset
|
24 """) |
