Top "Python-db-api" questions

Questions about how to use the Python Database API Specification 2.0 -- PEP 249.

Python, how to check if a result set is empty?

I have a sql statement that returns no hits. For example, 'select * from TAB where 1 = 2'. I want to check …

python resultset python-db-api
Inserting JSON into MySQL using Python

I have a JSON object in Python. I am Using Python DB-API and SimpleJson. I am trying to insert the …

python mysql json python-db-api
Python db-api: fetchone vs fetchmany vs fetchall

I just had a discussion today with some coworkers about python's db-api fetchone vs fetchmany vs fetchall. I'm sure the …

python mysql python-db-api
How to get a single result from a SQL query in python?

Is there an elegant way of getting a single result from an SQLite SELECT query when using Python? for example: …

python sql sqlite python-db-api
Transactions with Python sqlite3

I'm trying to port some code to Python that uses sqlite databases, and I'm trying to get transactions to work, …

python-2.7 sqlite python-db-api
how to safely generate a SQL LIKE statement using python db-api

I am trying to assemble the following SQL statement using python's db-api: SELECT x FROM myTable WHERE x LIKE 'BEGINNING_…

python sql sql-like python-db-api
Follow up: Execute .sql files from python

Over a year ago someone asked this question: Execute .sql files that are used to run in SQL Management Studio …

python sql sql-server pyodbc python-db-api
Escape SQL "LIKE" value for Postgres with psycopg2

Does psycopg2 have a function for escaping the value of a LIKE operand for Postgres? For example I may want …

python postgresql psycopg2 python-db-api
Set database connection timeout in Python

I'm creating a RESTful API which needs to access the database. I'm using Restish, Oracle, and SQLAlchemy. However, I'll try …

python database oracle cx-oracle python-db-api
difference between cursor and connection objects

I am confused about why python needs cursor object. I know jdbc and there the database connection is quite intuitive …

python python-db-api