I'm trying to fetch the data from server so I tried as follow
#!/usr/bin/python
import pymssql
conn = pymssql.connect(host='xxxx', user='xxx', password='xxx', database='xxx')
cursor = conn.cursor()
x2 = 'select * from result where url like\'%get content%\''
cursor.execute(x2)
data = cursor.fetchall()
field_names = [i[0] for i in cursor.description]
print field_names
print data
When I run this program it only give the column name, data variable is empty. I don't know what is the reason. How can I fix it?
I'm running the same script in windows there is no problem. But when I execute the script in Ubuntu 14.04 the data variable is empty.
-1. If query or connection is problem mean how the column gets print?