суббота, 25 января 2014 г.

Hint to fix pymssql in linux, that does not return any values from cursor

PyMssql package version  from equo repository - 1.0.2-r1
PyMssql package version i will install in next steps: 1.0.2


Simply uninstall current pymssql. For me its  
equo uninstall pymssql
Then install pip
equo install pip
And last step is instal pymssql from pip, so  
pip install pymssql 

And now this finally working:

import pymssql
con = pymmsql.connection(host='dbname', user='username', password='password', database='dbname')
cur = con.execute()
cur.execute('select * from TABLE where country = "Mexico"')
for i in cur:
    print(i)

Dunno why this does not work natively in pymssql package. But google surely help you if you need more info about it.



todo: the next step will be fight with with special language signs like <č>

cheers