pysqlite2 fetching from select different than pysqlite?
schwehr at gmail.com
schwehr at gmail.com
Thu Jul 27 10:00:53 EDT 2006
Thanks Tim! That works well. As a followup, is there a standard
compliant way to ask what fields are in the table?
-kurt
Tim Golden wrote:
> | I have some old pysqlite 1.x code that uses a pattern like this:
> |
> | cu.execute('SELECT weight FROM weights WHERE samplename="foo")
> | row = cu.fetchone()
> | weight=row['weight']
> |
>
> http://initd.org/pub/software/pysqlite/doc/usage-guide.html#accessing-co
> lumns-by-name-instead-of-by-index
>
> you have to specify a .row_factory before running the select
>
> TJG
More information about the Python-list
mailing list