Message388078
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 |
|
Date |
User |
Action |
Args |
2021-03-04 06:44:56 | toreanderson | set | recipients:
+ toreanderson, docs@python |
2021-03-04 06:44:55 | toreanderson | set | messageid: <1614840295.99.0.480319283179.issue43396@roundup.psfhosted.org> |
2021-03-04 06:44:55 | toreanderson | link | issue43396 messages |
2021-03-04 06:44:55 | toreanderson | create | |
|