On Tue, 20 Feb 2007, Paul McNett wrote:
> cur.execute("select * from test")
> rs = cur.fetchall()
> dict_cursor = []
> for rec in rs:
> d = {}
> for idx, fld in enumerate(cur.description):
> d[fld[0]] = rec[idx]
> dict_cursor.append(d)
Paul, et al.:
For several tables in our model, the above is very clear; there's a field
name and a value for each record in the table. Now I'd like to learn how to
handle the more complex cases such as this one:
self.cur.execute("select * from voting group by cat order by pos")
This table contains 31 columns (plus the built-in OID) for each
record/row. Should I not group by and order by in the select statement, but
do this in the banded ReportDesigner instead? If not, how should the
dictionary of tuples be created?
TIA,
Rich
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users