I have a big python tool that works perfectly when executed the binary that was compiled on a ubuntu14.04 machine, but the same tool is not working when compiled on 16.04 and it is giving me sql exceptions like below when my code tries to executecursor.fetchall()
of python's pyodbc module, please note that I have all the odbc and free_tds drivers setup on my 16.04 machine with same configuration that I have in my 14.04 machine and the version of python that I'm using on both 14.04 and 16.04 is 2.7.9 .
EXCEPTION_*****: ('HY003', u'[HY003] [FreeTDS][SQL Server]Program type out of range (0) (SQLGetData)')
How Am I compiling :pyinstaller --onefile --clean
But when the same sample code that was failing when executed as binary is working fine when ran the source code locally from terminal .
Can anyone help me if they come across any such sql exceptions from python when ran on Ubuntu16.04 machines
Sample code base that is giving exception when executed after compiling on Ubuntu16.04
def main:
import pyodbc
connection = pyodbc.connect("DRIVER=FreeTDS;SERVER=Oil;PORT=xyz;DATABASE=xyz;UID=abc;PWD=abcpassword;WSID=xyz;APP=xyz;TDS_VERSION=8.0", autocommit=True)
cursor=connection.cursor()
q="select top 10 * from xyztable"
execute = cursor.execute(q)
results=cursor.fetchall()
print results
Expected results are I should able to get the results back when I ran any SQL query fromcursor.fetchall()
of pyodbc module