Re: [cx-oracle-users] Results as dict
Brought to you by:
atuining
From: Amaury F. d'A. <ama...@gm...> - 2006-11-08 10:17:02
|
Christian Klinger wrote: > Hello cx_oracle users, > > who knows a simple way to get results from a fetchall as dict=B4s instead > of lists?? You may use the cursor.description to get the column names. Something like: data =3D cur.fetchall() desc =3D cur.description dict_data =3D [dict((col[0], value) for col, value in zip(desc, row)) for row in data] Hope this helps, --=20 Amaury |