jiangwen365 / pypyodbc

A pure Python Cross Platform ODBC interface module
MIT License
179 stars 74 forks source link

Get cur.execute(select).fetchone() cannot get element value by specify column name #74

Open Taitanguo opened 6 years ago

Taitanguo commented 6 years ago

cur.execute("SELECT BranchName FROM RunManager2.dbo.Branch WHERE BranchName = ? AND Official = ?", ["near", 1]) branch_id = cur.fetchone() print(branch_id.get('BranchName')) //this is not working but print(branch_id[0]) is working

I'm running on a python 3.4 environment