Re: [sqlite] Guidance with Python and nested cursors

2013-07-18 Thread Joseph L. Casale
It is perfectly allowed to open multiple cursors against a single connection. You can only execute one statement per cursor at a time, but you can have multiple cursors running from the same connection: cr1 = cn.cursor() cr2 = cn.cursor() cr1.execute('select ...') while True:

[sqlite] Guidance with Python and nested cursors

2013-07-17 Thread Joseph L. Casale
I am using Python to query a table for all its rows, for each row, I query related rows from a second table, then perform some processing and insert in to a third table. What is the technically correct approach for this? I would rather not accumulate all of the first tables data to make one off

Re: [sqlite] Guidance with Python and nested cursors

2013-07-17 Thread Petite Abeille
On Jul 17, 2013, at 9:07 PM, Joseph L. Casale jcas...@activenetwerx.com wrote: I am using Python to query a table for all its rows, for each row, I query related rows from a second table, then perform some processing and insert in to a third table. What is the technically correct approach

Re: [sqlite] Guidance with Python and nested cursors

2013-07-17 Thread Joseph L. Casale
From: sqlite-users-boun...@sqlite.org on behalf of Petite Abeille Sent: Wednesday, July 17, 2013 1:25 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Guidance with Python and nested cursors On Jul 17, 2013, at 9:07 PM, Joseph L. Casale

Re: [sqlite] Guidance with Python and nested cursors

2013-07-17 Thread Keith Medcalf
Subject: [sqlite] Guidance with Python and nested cursors I am using Python to query a table for all its rows, for each row, I query related rows from a second table, then perform some processing and insert in to a third table. What is the technically correct approach for this? I would rather

Re: [sqlite] Guidance with Python and nested cursors

2013-07-17 Thread Keith Medcalf
: Wednesday, 17 July, 2013 13:41 To: General Discussion of SQLite Database Subject: Re: [sqlite] Guidance with Python and nested cursors From: sqlite-users-boun...@sqlite.org on behalf of Petite Abeille Sent: Wednesday, July 17, 2013 1:25 PM To: General

Re: [sqlite] Guidance with Python and nested cursors

2013-07-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/07/13 18:37, Keith Medcalf wrote: cr1 = cn.cursor() cr2 = cn.cursor() cr1.execute('select ...') while True: row = cr1.fetchone() if not row: break While that is normal DBAPI, it is far more verbose and unpythonic than the SQLite wrappers