Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Working with recordsets

2 views
Skip to first unread message

chem...@gmail.com

unread,
Jan 7, 2005, 12:44:13 PM1/7/05
to
Hi.

I have one recorset that I would like to pass to 2 functions, one is
for create an CSV file and the other one is to create a HTML file. The
problem is that the recordset is totally read in the first function,
and then when I pass it to the second funtion the recordset is in the
last record.

I've read docs, but I think that one cursor doesn't have something
like movefirst() method. Anybody have an idea to solve this?

Thank's.

AdSR

unread,
Jan 7, 2005, 1:58:08 PM1/7/05
to

Try loading the whole recordset with the fetchall() method and use the
resulting sequence in your functions. It won't be memory-efficient but
it will be easy to do.

AdSR

Steve Holden

unread,
Jan 8, 2005, 2:22:33 PM1/8/05
to
AdSR wrote:

Or, if this doesn't suit, try creating two separate cursors from the
same connection and execute the same query on each. There's some chance
that your database driver/backend combination will optimize the queries
then.

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119

0 new messages