Can't i use oracle 10g express edition for sql with python? as i have it installed in my pc. Or i need to hv mysql to use sql with python. I am learning DBMS this semester so i hv Oracle 10g and in Python there is database part too but basically we are using sql. So why install MYsql?
python is a programming language which can communicate with any database for which there exists a driver. For Oracle that is cx_oracle. MySQL has a python connector. PostgreSQL uses the psycopg2 module.
So basically you can probably use whatever DBMS you are comfortable with. Unless your teacher has a specific flavour they want you to use. However, I would suggest you use a more recent version of Oracle XE than 10g. That's more than a decade old. I think you will have fewer driver compatibility issues if you use a modern version of whatever database you choose. For Oracle that's XE 18c.
Related
I'm trying to read large amounts of data from Postgres on Linux via Python. SQL Alchemy is unacceptably slow. turbodbc https://github.com/blue-yonder/turbodbc bills itself as being fast, but seems to require an ODBC source, which is Windows, not Linux, AFAIK. (The Postgres FTP site has only .dlls for ODBC.) Yet, it claims Linux / Postgres compatibility.
How do I access Postgres on Linux via turbodbc or any other ODBC?
turbodbc works with PostgreSQL and Linux. This requires the packages unixodbc and odbc-postgresql to be installed. Then you need to set up a data source according to PostgreSQL's specifications.
The one issue here is that it won't be blazingly fast. Turbodbc is just an efficient way to communicate with the ODBC driver, basically exploiting bulk operations. However, the ODBC driver freely available for PostgreSQL itself is pretty slow. There is not much turbodbc can do about this.
I'd recommend psycopg2 or asyncpg (the latter requires Python 3.5, but is indeed very fast).
I am trying to connect Python 2.7 to SQL Server to access all the tables it is currently hosting.
I am using for my official purposes so want only legal solutions to my problem.
Tried using a few of the solutions suggested her but none of them worked and most of them were not at all descriptive as I am new to Python.
Also is it possible to import a large table from SQL directly as a temp table(in python) and then work on it instead of accessing the DB everytime.
Details:
OS- Windows 10
DB- SQL Server 2012 (SQL server management studio)
Python- Spyder(Anaconda) for Python 2.7
thanks in advance for your help.
regards
Hitesh
I have a website on an Australian webhost. I have designed my website to allow people to login & their login details are stored in an SQLite3 database. I interact with the SQLite3 database using pythons SQLite3 module(found only in python2.5 & up)
My Problem: the webhost runs Python 2.4 so I cannot communicate with(query or modify) my SQLite3 database. The webhost will not allow me to install my own version of python or upload modules unless I upgrade to VPS.
What do you think are my options to still be able to work/interface with my SQL database? Do you know of way to interact with a SQL database using python modules from Python 2.4 or earlier?
Do you know of a python 2.4 module that will let me interact with an SQL database(can be MySQL, SQLite, etc.)?
There is a Python MySQL Module, called MySQLDB, which supports Python 2.3-2.7: http://sourceforge.net/projects/mysql-python/
The User Guide can be found here: http://mysql-python.sourceforge.net/MySQLdb.html
Check out pysqlite. It is the same module as in the newer python versions and I have used it no prob in 2.4 before.
I'm trying to use sqlalchemy on Cygwin with a MSSQL backend but I cannot seem to get any of the MSSQL Python DB APIs installed on Cygwin. Is there one that is known to work?
FreeTDS + unixodbc + pyodbc stack will work on Unix-like systems and should therefore work just as well in Cygwin. You should use version 8.0 of TDS protocol. This can be configured in connection string.
What is the best way to access sql server from python is it DB-API ?
Also could someone provide a such code using the DB-API how to connect to sql server from python and excute query ?
See pyodbc - Python Database API Specification v2.0 implementation. Works great.
Additionally you can use it with other databases. If using with SQL Server 2008, make sure you use Native Driver if you need to support new DATE data types.
See pymssql It is a DB-API module for MS Sql Server and would be the most pythonic way. The documentation includes examples.
If on a Windows OS you could also use OLEDB through COM which will not require any thing else to be installed on the client.
Also if you use Iron Python you can use the .Net APIs
Also could someone provide a such code using the DB-API
how to connect to sql server from python and excute query ?
This hello world snippet pretty much shows you the common way how to connect with SQL server in Python with an DBI 2.0 database interface module.
Disclaimer: I'm the developer of pypyodbc
ODBC + freetds + a python wrapper library for ODBC.