Working with recordsets
adsr at poczta.onet.pl
Fri Jan 7 13:58:08 EST 2005
chema.rey at gmail.com wrote:
> 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?
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.
More information about the Python-list