This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author toreanderson
Recipients docs@python, toreanderson
Date 2021-03-04.06:44:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614840295.99.0.480319283179.issue43396@roundup.psfhosted.org>
In-reply-to
Content
In https://docs.python.org/3/library/sqlite3.html, the following example code is found:

> # Do this instead
> t = ('RHAT',)
> c.execute('SELECT * FROM stocks WHERE symbol=?', t)
> print(c.fetchone())

However this fails as follows:

> Traceback (most recent call last):
>   File "./test.py", line 8, in <module>
>     print(c.fetchone())
> AttributeError: 'sqlite3.Connection' object has no attribute 'fetchone'

I believe the correct code should have been (at least it works for me):

> # Do this instead
> t = ('RHAT',)
> cursor = c.execute('SELECT * FROM stocks WHERE symbol=?', t)
> print(cursor.fetchone())

Tore
History
Date User Action Args
2021-03-04 06:44:56toreandersonsetrecipients: + toreanderson, docs@python
2021-03-04 06:44:55toreandersonsetmessageid: <1614840295.99.0.480319283179.issue43396@roundup.psfhosted.org>
2021-03-04 06:44:55toreandersonlinkissue43396 messages
2021-03-04 06:44:55toreandersoncreate