summaryrefslogtreecommitdiffstats
path: root/Doc/library/sqlite3.rst
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2022-07-29 07:40:44 (GMT)
committerGitHub <noreply@github.com>2022-07-29 07:40:44 (GMT)
commite9c8de669d40d993489981be2973d1ea5bd10d0c (patch)
treeab6dd6c431702b410e7b9912e1fe4ee5adb8b7cb /Doc/library/sqlite3.rst
parent3e7cad3bca64ab213c66e2bd41c9d1cf1d057526 (diff)
downloadcpython-e9c8de669d40d993489981be2973d1ea5bd10d0c.zip
cpython-e9c8de669d40d993489981be2973d1ea5bd10d0c.tar.gz
cpython-e9c8de669d40d993489981be2973d1ea5bd10d0c.tar.bz2
gh-95273: Condense sqlite3 executescript example (#95383)
Diffstat (limited to 'Doc/library/sqlite3.rst')
-rw-r--r--Doc/library/sqlite3.rst11
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 545f679..1d44540 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -1007,9 +1007,16 @@ Cursor Objects
*sql_script* must be a :class:`string <str>`.
- Example:
+ Example::
- .. literalinclude:: ../includes/sqlite3/executescript.py
+ # cur is an sqlite3.Cursor object
+ cur.executescript("""
+ begin;
+ create table person(firstname, lastname, age);
+ create table book(title, author, published);
+ create table publisher(name, address);
+ commit;
+ """)
.. method:: fetchone()