Questions tagged [pypyodbc]

pypyodbc is a pure Python ODBC interface module. (Not to be confused with pyodbc, which performs many of the same functions but was written as an *extension module* in C++.)

pypyodbc is a pure Python interface module. It is very similar to , which performs many of the same functions but was written as an extension module in C++.

In addition to being a very good ODBC Library in its own right, pypyodbc is a useful alternative to pyodbc in situations where pyodbc encounters difficulties.

For more information, see

pypyodbc - A Pure Python ODBC Library

Installation is available from pip:

pip install pypyodbc

Or by downloading installation package. (Unzip, navigate to folder, and run:)

python setup.py install
285 questions
4
votes
1 answer

Speed up Python executemany

I'm inserting data from one database to another, so I have 2 connections (Conn1 and Conn2). Below is the code (using pypyodbc). import pypyodbc Conn1_Query = "SELECT column FROM Table" Conn1_Cursor.execute(Conn1_Query) Conn1_Data =…
Epausti
  • 53
  • 1
  • 8
4
votes
3 answers

PypyODBC with parameters: [ODBC Microsoft Access Driver] Too few parameters. Expected 4

I'm using pypyodbc to select data from an access database. I am using the following query with three parameters which have been specified. I've tried a few varieties, but to no avail. I don't see anything wrong with my syntax. SELECT [Date],…
cjhines
  • 1,148
  • 3
  • 16
  • 32
4
votes
5 answers

"Optional feature not implemented (106) (SQLBindParameter)" error with pyodbc

I'm being driven nuts trying to figure this one out. I'm using Python for the first time, and trying to write data collected from twitter out to an Access 2010 database. The command I'm using is: cursor.execute('''insert into…
Kev Thomas
  • 43
  • 1
  • 1
  • 4
3
votes
4 answers

Can python cursor.execute accept multiple queries in one go?

Can the cursor.execute call below execute multiple SQL queries in one go? cursor.execute("use testdb;CREATE USER MyLogin") I don't have python setup yet but want to know if above form is supported by cursor.execute? import pyodbc # Some other…
Test
  • 564
  • 3
  • 12
3
votes
0 answers

Python pypyodbc ValueError: microsecond must be in 0..999999

What causes this error: ValueError: microsecond must be in 0..999999 Using Python 3 and pypyodbc version 1.3.5 The query is very simple and has worked for months. I can only stop the error by removing a column of type datetime2(7) with a value: …
Mattman85208
  • 1,858
  • 2
  • 29
  • 51
3
votes
2 answers

Python 3 and pypyodbc stored procedure error

I am currently running Python 3.4.2 and pypyodbc 1.3.6. I am trying to run a stored procedure on a SQL server. When I run the stored procedure without the needed parameter (a date) I get an error stating that a parameter is needed (this was…
3
votes
2 answers

('HY000', 'The SQL contains 21 parameter markers, but 1 parameters were supplied')

I'm trying to read a csv file and upload in SQL. Here is the code. I'm getting this error "pypyodbc.ProgrammingError: ('HY000', 'The SQL contains 21 parameter markers, but 1 parameters were supplied')" My csv file has 21 columns. Do you know how to…
Partha Mitra
  • 55
  • 1
  • 1
  • 10
3
votes
2 answers

"Invalid cursor state" error when executing a batch that includes a USE statement

I tried retrieving data from a Microsoft SQL database using pypyodbc 1.3.3 with Python 3.5 on Windows but got a pypyodbc.ProgrammingError '[24000] [Microsoft] [SQL Server Native Client 11.0] Invalid cursor state' using the following code: import…
Lapuranebar
  • 31
  • 1
  • 3
3
votes
1 answer

pypyodbc: OPENJSON incorrect syntax near keyword "WITH"

I'm trying to use OPENJSON in a Python script to import some basic JSON into a SQL database. I initially tried with a more complex JSON file, but simplified it for the sake of this post. Here's what I have: sql_statement = "declare @json…
user1944673
  • 279
  • 1
  • 4
  • 13
3
votes
1 answer

Connect OracleDB in Python

I need to connect Oracle DB and run scripts in Python but not sure how to do it. I currently use Oracle SQL Developer to run my queries. Please help, Attached screen shot has connection details from Oracle SQL Developer.
Santhosh
  • 549
  • 2
  • 6
  • 10
3
votes
2 answers

Python SQL update query: string or integer address expected instead of instance instance

I use Python 2.7 and pypyodbc in order to run SQL queries but whenever I run the update query using python, cursor.execute("UPDATE tbl_User SET gender = ? WHERE id = 1", ['male']) I get the error: TypeError: string or integer address expected…
Shani Gamrian
  • 345
  • 1
  • 4
  • 18
3
votes
1 answer

How to export MS Access table into a csv file in Python using e.g. pypyodbc

I have been trying to export a table from MS Access database into a csv file using pypydobc - using fetchone function is taking forever e.g. 200,000 rows are taking about 5 minutes to print. If fetchone was quicker I could have just printed the…
Curtis
  • 1,157
  • 4
  • 17
  • 30
3
votes
3 answers

Issue querying from Access database: "could not convert string to float: E+6"

I have a database in MS Access. I am trying to query one table to Python using pypyodbc. I get the following error message: ValueError: could not convert string to float: E+6 The numbers in the table are fairly big, with up to ten significant…
David
  • 327
  • 1
  • 3
  • 11
3
votes
1 answer

Possible for 64bit Python to connect with 32bit MS access driver?

How can I use the 32bit MS access driver for odbc connection in python 64bit? Can it be done by altering the environment handle or odbc constants in pypyodbc, or creating a bit conversion file? Another thought (not sure if possible): Is there a way…
asdf
  • 836
  • 1
  • 12
  • 29
3
votes
2 answers

I am using pypyodbc.connect - Is there a way to give it an appname?

In _mssql.connect, there is an option to add appname. I'm wondering if pypyodbc.connect has something similar. Thank you.
user1327390
  • 131
  • 1
  • 2
  • 7
1
2
3
18 19