cx-oracle

“error: cannot locate an Oracle software installation” When trying to install cx_Oracle

て烟熏妆下的殇ゞ 提交于 2019-12-06 19:00:12
问题 Newbie here trying to use python to do some database analysis. I keep getting the error: "error: cannot locate an Oracle software installation" When installing CX_oracle (via easy_install). The problem is I do not have oracle on my local machine, I'm trying to use python to connect to the main oracle server. I have have setup another program to do this(visualdb) and I had a .jar file I used as the driver but I'm not sure how to use it in this case. Any suggestions? 回答1: Don't use easy_install

Fetching huge data from Oracle in Python

怎甘沉沦 提交于 2019-12-06 16:21:57
问题 I need to fetch huge data from Oracle (using cx_oracle) in python 2.6, and to produce some csv file. The data size is about 400k record x 200 columns x 100 chars each. Which is the best way to do that? Now, using the following code... ctemp = connection.cursor() ctemp.execute(sql) ctemp.arraysize = 256 for row in ctemp: file.write(row[1]) ... ... the script remain hours in the loop and nothing is writed to the file... (is there a way to print a message for every record extracted?) Note: I don

cx_Oracle And User Defined Types

佐手、 提交于 2019-12-06 13:37:31
Does anyone know an easier way to work with user defined types in Oracle using cx_Oracle? For example, if I have these two types: CREATE type my_type as object( component varchar2(30) ,key varchar2(100) ,value varchar2(4000)) / CREATE type my_type_tab as table of my_type / And then a procedure in package my_package as follows: PROCEDURE my_procedure (param in my_type_tab); To execute the procedure in PL/SQL I can do something like this: declare l_parms my_type_tab; l_cnt pls_integer; begin l_parms := my_type_tab(); l_parms.extend; l_cnt := l_parms.count; l_parms(l_cnt) := my_type('foo','bar',

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

拟墨画扇 提交于 2019-12-06 11:41:30
问题 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

Named Parameters with a Oracle stored procedure in Python

 ̄綄美尐妖づ 提交于 2019-12-06 08:14:19
Trying to call an existing stored procedure, but using named parameters, first parameter should retain default value (in this case NULL). I've spent way too long trying to get this working, any ideas? create or replace procedure so_test(p1 in varchar2 default null, p2 in varchar2 default null, p3 in varchar2 default null) as begin null; end; import cx_Oracle db = cx_Oracle.connect('/@XTS_DEV.CLIENT') cur = db.cursor() cur.callproc("so_test", ('X', 'Y', 'Z')) cur.callproc("so_test(p2=>:1, p3=>:2)", ('Y', 'Z')) Traceback (most recent call last): File "C:\Users\PatrickJolliffe\so_test.py", line 5

Importing from Oracle using the correct encoding with Python

自作多情 提交于 2019-12-06 05:56:42
I apologize for making a character encoding question since I know you folk get many everyday, but I couldn't figure out my problem so I asked anyway. Here is what we are doing: Take Data from an Oracle DB using Python and cx_Oracle . Write the data to a file using Python. Ingest the file into Postgres using Python and psycopg2 . Here are the important Oracle settings: SQL> select * from NLS_DATABASE_PARAMETERS; PARAMETER VALUE ------------------------------ ---------------------------------------- NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC

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

三世轮回 提交于 2019-12-06 05:48:52
问题 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

cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle

浪子不回头ぞ 提交于 2019-12-06 04:34:31
问题 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

cx_Oracle: distutils.errors.DistutilsSetupError: cannot locate Oracle include files even with SDK

ε祈祈猫儿з 提交于 2019-12-06 01:15:41
Trying to install cx_Oracle for Python 3.4 on Centos. I have installed Oracle client 11.2.0.1 (actually has two copies, as one requires encrypted connection while the other doesn't, so I have /usr/lib/oracle/11.2/client64 and /usr/lib/oracle/11.2.99/client64) $ echo $ORACLE_HOME /usr/lib/oracle/11.2/client64 $ python3.4 --version Python 3.4.3 I have the SDK installed: $ ls -all $ORACLE_HOME/sdk/include total 1640 drwxrwxr-x 2 root root 4096 Aug 15 2009 . drwxrwxr-x 4 root root 4096 Aug 15 2009 .. -r-xr-xr-x 1 root root 42534 Aug 15 2009 ldap.h -r--r--r-- 1 root root 34157 Aug 15 2009 nzerror.h

cx_oracle and python 2.7 [duplicate]

梦想与她 提交于 2019-12-05 23:35:38
问题 This question already has answers here : Python module “cx_Oracle” module could not be found (4 answers) Closed last year . 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: