Dennis Lee Bieber wrote:
> cursor.description -- after an .execute() has selected data.
Thanks Dennis, The desciription works, but gives some funky results,
but with python it is not a big deal.
cu.description
(('activity_id', None, None, None, None, None, None),
('case_id', None, None
Perfect. Thanks much!
-kurt
>
> from pysqlite2 import dbapi2 as sqlite
>
> db = sqlite.connect (":memory:")
> db.row_factory = sqlite.Row
>
> db.execute ("CREATE TABLE x (i INTEGER, code VARCHAR (10), name VARCHAR
> (60))")
>
> for row in db.execute ("PRAGMA TABLE_INFO ('x')"):
> print row['n
[EMAIL PROTECTED]
| Sent: 27 July 2006 15:01
| To: python-list@python.org
| Subject: Re: pysqlite2 fetching from select different than pysqlite?
|
| Thanks Tim! That works well. As a followup, is there a standard
| compliant way to ask what fields are in the table?
|
| -kurt
Assuming this is
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.fe
[EMAIL PROTECTED]
| 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']
|
| It seems like lookups by name are no longer supported in
| pysqlite2.
According to this:
ht
Hi All,
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']
It seems like lookups by name are no longer supported in pysqlite2. Is
that true? And if not, and I want to do a SELE