[docs] Bug in sqlite package doc

Andrew Svetlov andrew.svetlov at gmail.com
Fri Nov 30 17:34:26 CET 2012


`c` is the cursor instance. Connection instance named `conn` in example.

On Mon, Nov 19, 2012 at 1:56 PM, Byron Foster <byron at base2.cc> wrote:
> 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!
>
> _______________________________________________
> docs mailing list
> docs at python.org
> http://mail.python.org/mailman/listinfo/docs
>



-- 
Thanks,
Andrew Svetlov


More information about the docs mailing list