]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95432: Fixup sqlite3 tutorial example (GH-95431)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 29 Jul 2022 12:38:08 +0000 (05:38 -0700)
committerGitHub <noreply@github.com>
Fri, 29 Jul 2022 12:38:08 +0000 (05:38 -0700)
- the insert statement should have five placeholders, not four
- missing ... in the multiline row list
(cherry picked from commit 2fbee85931296bbeddae6358583e400ce5321f89)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Doc/library/sqlite3.rst

index 32a5cfe2fb10da92062b30e3481a39a20df1a848..061207b59249b5546f722ae98dc317e7e0216fb5 100644 (file)
@@ -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::