Skip to content
Advertisement

Tag: pyodbc

INSERT INTO SELECT based on a dataframe

I have a dataframe df and I want to to execute a query to insert into a table all the values from the dataframe. Basically I am trying to load as the following query: For that I have the following code: However, I am getting the following error: Does anyone know what I am doing wrong? Answer See below my

Multithreaded pyodbc connection

I am trying to use a pyodbc connection in multiple threads. I am receieving the following error: Connection is busy with results for another command (0) (SQLExecDirectW)’). I also tried setting MultipleActiveResultSets=yes; and got the same results. I really don’t want to have to create a connection for every thread or query. I also don’t want to use a lock

Can’t open lib ‘ODBC Driver 13 for SQL Server’? Sym linking issue?

When I try to connect to a sql server database with pyodbc (on mac): I get the following error: Error: (‘01000’, “[01000] [unixODBC][Driver Manager]Can’t open lib ‘ODBC Driver 13 for SQL Server’ : file not found (0) (SQLDriverConnect)”) When I path in the actual driver location: It starts working! My odbcinst.ini looks like this: How can I get my reference

Function sequence error in PYODBC

I am using pyodbc to connect to a database and extract certain data from it. Here is my code: And I got following error after I run above code: pyodbc.Error: (‘HY010’, ‘[HY010] [Microsoft][ODBC SQL Server Driver]Function sequence error (0) (SQLFetch)’) May I know what caused such problem, and how can I fix it? Thanks. Answer I believe your problem is

Retrieving Data from SQL Using pyodbc

I am trying to retrieve data from an SQL server using pyodbc and print it in a table using Python. However, I can only seem to retrieve the column name and the data type and stuff like that, not the actual data values in each row of the column. Basically I am trying to replicate an Excel sheet that retrieves

Advertisement