Re: pysqlite2 fetching from select different than pysqlite?

2006-07-27 Thread schwehr
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

Re: pysqlite2 fetching from select different than pysqlite?

2006-07-27 Thread schwehr
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

RE: pysqlite2 fetching from select different than pysqlite?

2006-07-27 Thread Tim Golden
[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

Re: pysqlite2 fetching from select different than pysqlite?

2006-07-27 Thread schwehr
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

RE: pysqlite2 fetching from select different than pysqlite?

2006-07-27 Thread Tim Golden
[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