<div dir="ltr"><div>==============================================================</div><div>SQLITE3 Function </div><div><br></div><div>def get_db():</div><div> def dict_factory(cursor, row):</div><div> d = {}</div><div> for idx, col in enumerate(cursor.description):</div><div> d[col[0]] = row[idx]</div><div> return d</div><div><br></div><div> db = getattr(g, '_database', None)</div><div> if db is None:</div><div> db = g._database = sqlite3.connect(DATABASE)</div><div> db.row_factory = dict_factory</div><div> return db</div><div>================================================================</div><div><br></div><div>I try this form but isnt ok . Can I help me ? </div><div><br></div><div><br></div><div>import cx_Oracle</div><div>con = cx_Oracle.connect('xxxx/xxxx@xxxxxxx/xxxxxxx')</div><div><br></div><div>cur = con.cursor()</div><div>cur.execute("select * from test")</div><div><br></div><div>desc = [d[0] for d in cur.description]</div><div><br></div><div>result = [dict(zip(dec,line))for line in cur]</div><div><br></div><div>print (result)</div><div><br></div><div>cur.close()</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Carlos Eugênio<br><div><br></div></div></div>
</div>