Re: [cx-oracle-users] Results as dict
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2006-11-08 15:26:17
|
On 11/8/06, Christian Klinger <ckl...@no...> wrote: > Amaury Forgeot d'Arc schrieb: > > Christian Klinger wrote: > >> Hello cx_oracle users, > >> > >> who knows a simple way to get results from a fetchall as dict=B4s inst= ead > >> of lists?? > > > > You may use the cursor.description to get the column names. Something l= ike: > > > > 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, > > > Helps perfect, > > btw other database-modules have out of the box solutions for this > (mysql,informix) How do they go about this? Is that all they do or is there some switch or some different method call that they make? > thx a lot > > christian > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job ea= sier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |