cx-oracle

Package : cx_Oracle for Python 3.5, windows64 bit. Oracle 11.2.0.1.0

ぃ、小莉子 提交于 2019-12-04 17:31:38
I am trying to install cx_Oracle on my windows PC. I ran following command in command prompt: pip install cx_Oracle This is giving me the following error: Collecting cx-Oracle Could not find a version that satisfies the requirement cx-Oracle (from versions: ) No matching distribution found for cx-Oracle I am using windows 64bit machine and Python 3.5(Anaconda3) . Intsalled Oracle vcersion on my PC is Oracle 11.2.0.1.0 and oracle-instantclient version oracle-instantclient-11.2.0.4.0-0 Please let me know what am I missing. Should I downgrade my python version to 3.4? If yes, than how to do it

cx_Oracle.DatabaseError: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

佐手、 提交于 2019-12-04 11:32:06
I am trying to do a sanity testing of newly installed Oracle client 12.2 in RHEL 7 linux from a Python program, but it fails with the above error, not sure what I am missing on there. Please help with this case : cx_Oracle.DatabaseError: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor my tnsnames.ora file under /home directory FRDLD2D1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = frdld2d1.de.db.com)(Port = 1825)) ) (CONNECT_DATA = (SID = FRDLD2D1) ) ) and my python program goes below #!/usr/bin/python import cx_Oracle

cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle

落花浮王杯 提交于 2019-12-04 09:03:58
I trying to build a binary using pyinstaller in a Linux environment. I've installed cx_Oracle. When I ran the script it runs fine without any error. However, after building the binary (I use anaconda python package and pyinstaller) when I run the binary it throws me the following error. Could anyone shed some light on this? I've surfed the issues that discuss py2exe and the same problem, however I couldn't get anything which I can understand as my case is linux and pyinstaller. Following is the error: LOADER: extracted pyi_importers LOADER: Installing import hooks LOADER: out00-PYZ.pyz LOADER:

cx_Oracle: How do I iterate over a result set?

守給你的承諾、 提交于 2019-12-04 07:58:52
问题 There are several ways to iterate over a result set. What are the tradeoff of each? 回答1: The canonical way is to use the built-in cursor iterator. curs.execute('select * from people') for row in curs: print row You can use fetchall() to get all rows at once. for row in curs.fetchall(): print row It can be convenient to use this to create a Python list containing the values returned: curs.execute('select first_name from people') names = [row[0] for row in curs.fetchall()] This can be useful

Authentication with public keys and cx_Oracle using Python

╄→尐↘猪︶ㄣ 提交于 2019-12-04 06:58:26
I've Googled a bit but I haven't found any substantial results. Is it possible to use key-based authentication to connect to an Oracle server using Python? My objective is to be able to automate some reporting I'm doing with Python without having to store a username/password anywhere in the server. One possible solution is to implement Oracle Wallet. Creating an Oracle Wallet entry involves having: a tnsname resolution name established for the said instance a username and password Example: The Oracle sid I'm working with is named ORCL, the user I have to connect with is named my_user. In your

How to use Pandas Write_Frame to export results to Oracle Database in cx_Oracle

走远了吗. 提交于 2019-12-04 05:55:25
I am trying to export a Pandas DataFrame to an Oracle database. I have come across the Write_Frame function in Pandas which sounds like exactly what I need. However, I have done tons of searches online and just can't get it to work. I have imported cx_Oracle and can connect to the Oracle database as well as running SQL queries without any problems, but when I run this it gives me a ' NotImplementedError ': import pandas.io.sql as psql output = psql.write_frame(MyResults, name = 'MySchema.MyTable', con = MyCon, flavor = 'oracle', if_exists = 'replace') So far I have seen many examples of wrtie

cx_oracle and python 2.7 [duplicate]

这一生的挚爱 提交于 2019-12-04 04:58:06
This question already has an answer here: Python module “cx_Oracle” module could not be found 4 answers Im using python 2.7 and cx_oracle ( Windows x86 Installer (Oracle 10g, Python 2.7) ) and 'm having a bad time to set this simple example bellow to work: import cx_Oracle connection = cx_Oracle.connect('user/pass@someserver:port') cursor = connection.cursor() cursor.execute('select sysdate from dual') for row in cursor: print row connection.close() Error Message: Traceback (most recent call last): File "C:\ORACON.py", line 1, in <module> import cx_Oracle ImportError: DLL load failed: The

How do I access an Oracle db without installing Oracle's client and cx_Oracle?

三世轮回 提交于 2019-12-04 01:38:09
I have two RHEL servers running Python 2.4 and 2.6 separately. There is an Oracle database on the other server I need to access. I was trying to install cx_oracle on my RHEL server but found out that the Oracle client must be installed first. The problem is, I don’t have permission to install Oracle's client on both RHEL servers. On the same servers, a Perl program can connect to the Oracle db using: DBI->connect("dbi:Oracle:host=myhost.prod.com;sid=prddb",'username','password') Can Python do the same without installing cx_oracle and the Oracle client? Or are there any suggestions about how to

Anaconda 3.5 (64bit Windows) Install cx_Oracle

て烟熏妆下的殇ゞ 提交于 2019-12-03 12:56:38
I have installed Anaconda 3.5 for Windows 64bits, and I need to connect to the Oracle database using package "cx_Oracle". I tried with the anaconda way: conda install -c https://conda.anaconda.org/anaconda cx_oracle The error messages below: Hint: the following packages conflict with each other: - cx_oracle - python 3.5* Use 'conda info cx_oracle' etc. to see the dependencies for each package. Note that the following features are enabled: - vc14 It seems that cx_oracle isn't compatible with Python 3.5. After this, I also tried to install directly with the binary: python setup.py install It

cx_Oracle: How can I receive each row as a dictionary?

牧云@^-^@ 提交于 2019-12-03 12:25:22
By default, cx_Oracle returns each row as a tuple. >>> import cx_Oracle >>> conn=cx_Oracle.connect('scott/tiger') >>> curs=conn.cursor() >>> curs.execute("select * from foo"); >>> curs.fetchone() (33, 'blue') How can I return each row as a dictionary? Mark Harrison You can override the cursor's rowfactory method. You will need to do this each time you perform the query. Here's the results of the standard query, a tuple. curs.execute('select * from foo') curs.fetchone() (33, 'blue') Returning a named tuple: def makeNamedTupleFactory(cursor): columnNames = [d[0].lower() for d in cursor