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:
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
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
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
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
: 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
-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