Skip to content

Commit

Permalink
pythongh-95432: Fixup sqlite3 tutorial example (pythonGH-95431)
Browse files Browse the repository at this point in the history
- the insert statement should have five placeholders, not four
- missing ... in the multiline row list
(cherry picked from commit 2fbee85)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
  • Loading branch information
erlend-aasland authored and miss-islington committed Jul 29, 2022
1 parent a41b51d commit 28cfb0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down

0 comments on commit 28cfb0e

Please sign in to comment.