[egenix-users] sql without zsql

M.-A. Lemburg mal at lemburg.com
Wed Oct 15 00:13:52 CEST 2003


nwingfield at che-llp.com wrote:
> Without using a ZSQL method, can I get a usable recordset in the form of
> the recordset a ZSQL method returns?  Right now I'm trying to work with the
> unwieldy data structure returned by the mxODBC "query()" method.  It looks
> something like ([column details], [data]).  I would like to get my hands on
> a recordset object that allows me to loop over the recordset and use dot
> notation to access each field's value by name.

Try wrapping the results from .query() into a Zope Results
object:

from Shared.DC.ZRDB.Results import Results
rs = Results(conn.query('...'))

The same also works for .execute() and .executemany().

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Oct 14 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the egenix-users mailing list