[Python-checkins] gh-95432: Fixup sqlite3 tutorial example (#95431)
erlend-aasland
webhook-mailer at python.org
Fri Jul 29 08:31:45 EDT 2022
https://github.com/python/cpython/commit/2fbee85931296bbeddae6358583e400ce5321f89
commit: 2fbee85931296bbeddae6358583e400ce5321f89
branch: main
author: Erlend Egeberg Aasland <erlend.aasland at protonmail.com>
committer: erlend-aasland <erlend.aasland at protonmail.com>
date: 2022-07-29T14:31:41+02:00
summary:
gh-95432: Fixup sqlite3 tutorial example (#95431)
- the insert statement should have five placeholders, not four
- missing ... in the multiline row list
files:
M Doc/library/sqlite3.rst
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 6a430f00aea4d..3df41b5419495 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -79,11 +79,11 @@ Now, let us insert three more rows of data,
using :meth:`~Cursor.executemany`::
>>> data = [
- ('2006-03-28', 'BUY', 'IBM', 1000, 45.0),
- ('2006-04-05', 'BUY', 'MSFT', 1000, 72.0),
- ('2006-04-06', 'SELL', 'IBM', 500, 53.0),
- ]
- >>> cur.executemany('INSERT INTO stocks VALUES(?, ?, ?, ?)', data)
+ ... ('2006-03-28', 'BUY', 'IBM', 1000, 45.0),
+ ... ('2006-04-05', 'BUY', 'MSFT', 1000, 72.0),
+ ... ('2006-04-06', 'SELL', 'IBM', 500, 53.0),
+ ... ]
+ >>> cur.executemany('INSERT INTO stocks VALUES(?, ?, ?, ?, ?)', data)
Then, retrieve the data by iterating over the result of a ``SELECT`` statement::
More information about the Python-checkins
mailing list