Skip to content

Commit e9c8de6

Browse files
author
Erlend Egeberg Aasland
authored
pythongh-95273: Condense sqlite3 executescript example (python#95383)
1 parent 3e7cad3 commit e9c8de6

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

Doc/includes/sqlite3/executescript.py

-25
This file was deleted.

Doc/library/sqlite3.rst

+9-2
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,16 @@ Cursor Objects
10071007

10081008
*sql_script* must be a :class:`string <str>`.
10091009

1010-
Example:
1010+
Example::
10111011

1012-
.. literalinclude:: ../includes/sqlite3/executescript.py
1012+
# cur is an sqlite3.Cursor object
1013+
cur.executescript("""
1014+
begin;
1015+
create table person(firstname, lastname, age);
1016+
create table book(title, author, published);
1017+
create table publisher(name, address);
1018+
commit;
1019+
""")
10131020

10141021

10151022
.. method:: fetchone()

0 commit comments

Comments
 (0)