Skip to content

Commit 61ac35d

Browse files
Erlend Egeberg Aaslandmiss-islington
authored andcommitted
pythongh-95273: Condense sqlite3 executescript example (pythonGH-95383)
(cherry picked from commit e9c8de6) Co-authored-by: Erlend Egeberg Aasland <[email protected]>
1 parent 5632c98 commit 61ac35d

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

Doc/includes/sqlite3/executescript.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

Doc/library/sqlite3.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,9 +798,16 @@ Cursor Objects
798798

799799
*sql_script* must be a :class:`string <str>`.
800800

801-
Example:
801+
Example::
802802

803-
.. literalinclude:: ../includes/sqlite3/executescript.py
803+
# cur is an sqlite3.Cursor object
804+
cur.executescript("""
805+
begin;
806+
create table person(firstname, lastname, age);
807+
create table book(title, author, published);
808+
create table publisher(name, address);
809+
commit;
810+
""")
804811

805812

806813
.. method:: fetchone()

0 commit comments

Comments
 (0)