[docs] Bug in sqlite package doc

Byron Foster byron at base2.cc
Mon Nov 19 12:56:31 CET 2012


On the following page:

11.13. sqlite3 — DB-API 2.0 interface for SQLite databases — Python v2.7.3 documentation

Search for  "fetchone"

the first match will take you to the following code:

# Do this instead
t = ('RHAT',)
c.execute('SELECT * FROM stocks WHERE symbol=?', t)
print c.fetchone()
c however is a connection object, it does not contain 'fetchone'

I believe the author meant something like the following:

# Do this instead
t = ('RHAT',)
cur = c.execute('SELECT * FROM stocks WHERE symbol=?', t)
print cur.fetchone()
Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20121119/62cc1f68/attachment-0001.html>


More information about the docs mailing list