0

Have been using this method for a long time and recently, out of nowhere, I began to receive error messages like this:

(pyodbc.Error) ('HY010', '[HY010] [Microsoft][ODBC Driver 17 for SQL Server]Function sequence error (0) (SQLGetData)') (Background on this error at: https://sqlalche.me/e/14/dbapi)

I'm establishing connection to Azure SQL

SQL_obj = SQL.sql_db(curr_env=os.getenv('curEnv'), 
                        server = os.getenv('sqlServer') + '.database.windows.net' , 
                        database = os.getenv('sqlDB'))  

Then connecting to it

SQL_obj._connect(cnxn_type = 'SQL', sql_username = os.getenv('USRNAME'), sql_password = os.getenv('PSWD'))

engine = SQL_obj._engine()

And writing data to sql after

myDf.to_sql('table_name',engine, index=False, if_exists='append')

Would appreciate any help regarding this problem. Read a lot of documentation, and couldn't find anything. Thank you.

  • Looks to be a data-specific issue. We will need to see `myDf` data frame. Please see [How to make good reproducible pandas examples](https://stackoverflow.com/q/20109391/1422451). Check for any special data types. No nested objects should be in columns. – Parfait Oct 20 '22 at 21:12

0 Answers0