cx-oracle

python cx oracle expecting string, unicode or buffer object

梦想与她 提交于 2019-12-01 12:56:28
问题 I am trying to run following code snippet in python to connect to oracle, but constantly running into following error. I have tried a lot of combinations but it doesn't seem to work. I understand the error, but don't understand what is incompatible here. Has anyone come across this issue? How do I fix it? File "", line 1, in File "/workplace/applications/python2.7/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1613, in execute connection = self.contextual_connect(close_with

Deploying cx_Oracle onto various versions of Oracle Client

筅森魡賤 提交于 2019-12-01 09:07:28
问题 I have some small python apps that use cx_Oracle to connect to an Oracle database. I deploy these apps by compiling them with py2exe, which works fine in many cases. The problem is, there is no standard Oracle Client version (9i and 10g for example) across the many people who need to install this, and it would be very frustrating to try to get everyone to standardize on a single Oracle Client version. I'm using the 9.2 client with cx_Oracle 4.4.1 for 9i at the moment, and so when I py2exe the

Connecting to Oracle RDS

巧了我就是萌 提交于 2019-12-01 06:13:25
I am trying to connect to Oracle using AWS lambda and python. These are the step I followed. (Everything has done EC2 instance) Downloaded the instantclient-basic-linux.x64-12.2.0.1.0.zip and instantclient-sdk-linux.x64-12.2.0.1.0.zip Created this folder structure ~/lambda/lib/ Extracted the zip files in the ~/lambda/lib/ copied the libaio.so.1.0.1 from /lib64/ into ~/lambda/lib/ Created symbolic link of libaio.so.1.0.1 as libaio.so in ~/lambda using pip installed cx_Oracle in ~/lambda written below index.py script in ~lambda ` import cx_Oracle def handler(event, context): message = "" cursor

Connecting to Oracle RDS

久未见 提交于 2019-12-01 05:59:05
问题 I am trying to connect to Oracle using AWS lambda and python. These are the step I followed. (Everything has done EC2 instance) Downloaded the instantclient-basic-linux.x64-12.2.0.1.0.zip and instantclient-sdk-linux.x64-12.2.0.1.0.zip Created this folder structure ~/lambda/lib/ Extracted the zip files in the ~/lambda/lib/ copied the libaio.so.1.0.1 from /lib64/ into ~/lambda/lib/ Created symbolic link of libaio.so.1.0.1 as libaio.so in ~/lambda using pip installed cx_Oracle in ~/lambda

How to install cx_Oracle on El Capitan

耗尽温柔 提交于 2019-12-01 05:10:38
As I understand it, there was some change related to SIP that makes installing this difficult. These pages have the background and advice to install. http://sourceforge.net/p/cx-oracle/mailman/message/34534872/ , http://stefanoapostolico.com/2015/10/08/install_cx_oracle_with_sip_enabled.html Putting all this together, here was my best shot at installing it to my virtualenv but alas, still no good. The error I'm getting is: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: dlopen(/Users/me/sx_direct_env/lib/python2.7/site-packages/cx_Oracle.so, 2): Library not

cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: “dlopen(libclntsh.dylib, 1): image not found”

 ̄綄美尐妖づ 提交于 2019-12-01 03:15:37
问题 I am trying to set up cx_Oracle to work with Python. I am using Python 2.7.10, 64-bit cx_Oracle version 6.0.2 MacOS Sierra 10.12.6 I set the following environment variables: export ORACLE_HOME="/Volumes/DATA/Programs/PY/instantclient_12_1" export DYLD_LIBRARY_PATH="$ORACLE_HOME:$DYLD_LIBRARY_PATH" export LD_LIBRARY_PATH=$ORACLE_HOME export PATH=$PATH:$ORACLE_HOME export ORACLE_SID=edocd export TNS_ADMIN=/Volumes/DATA/Programs/PY/instantclient_12_1/network/admin export TWO_TASK=${ORACLE_SID}

InterfaceError: Unable to acquire Oracle environment handle; ORACLE_HOME is correct and SQL*Plus will connect

拈花ヽ惹草 提交于 2019-11-30 17:47:39
I'm getting the standard "DLL load failed; module not found" error when trying to import cx_Oracle. I have the proper instant client installed, the paths are all correct... running Dependency Walker tells me I'm missing the following .dll's MSVCR90, GPSVC, IESHIMS. I'm running the instant client for Oracle 11g and Python 2.7. Anyone have any ideas? Most of the answers I have found entail an incorrect path, but that doesn't seem to be the case... additionally, I can't find any of those .dll's anywhere else on my system. EDIT: I ended up installing Oracle XE 11g (32 bit); both Python 2.7 and the

Issue building cx_Oracle - libclntsh.so.11.1 => not found

假装没事ソ 提交于 2019-11-30 05:56:36
I'm trying to build cx_Oracle for a Python 2.7.2 and Oracle 11g installation but the built cx_Oracle.so cannot find libclntsh.so.11.1 so importing cx_Oracle in Python fails. /mypath/cx_Oracle-5.1.1/build/lib.linux-x86_64-2.7-11g]$ ldd cx_Oracle.so libclntsh.so.11.1 => not found libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ae9be290000) libc.so.6 => /lib64/libc.so.6 (0x00002ae9be4ab000) /lib64/ld-linux-x86-64.so.2 (0x000000389b600000) I have libclntsh.so.11.1 in my Oracle client installation directory: /apps/oracle/client/11.2.0.1/home1/lib]$ ls -l libclntsh.so* libclntsh.so -> /apps/oracle

InterfaceError: Unable to acquire Oracle environment handle; ORACLE_HOME is correct and SQL*Plus will connect

你。 提交于 2019-11-30 01:46:31
问题 I'm getting the standard "DLL load failed; module not found" error when trying to import cx_Oracle. I have the proper instant client installed, the paths are all correct... running Dependency Walker tells me I'm missing the following .dll's MSVCR90, GPSVC, IESHIMS. I'm running the instant client for Oracle 11g and Python 2.7. Anyone have any ideas? Most of the answers I have found entail an incorrect path, but that doesn't seem to be the case... additionally, I can't find any of those .dll's

cx_Oracle and Exception Handling - Good practices?

折月煮酒 提交于 2019-11-29 21:30:21
I'm trying to use cx_Oracle to connect to an Oracle instance and execute some DDL statements: db = None try: db = cx_Oracle.connect('username', 'password', 'hostname:port/SERVICENAME') #print(db.version) except cx_Oracle.DatabaseError as e: error, = e.args if error.code == 1017: print('Please check your credentials.') # sys.exit()? else: print('Database connection error: %s'.format(e)) cursor = db.cursor() try: cursor.execute(ddl_statements) except cx_Oracle.DatabaseError as e: error, = e.args if error.code == 955: print('Table already exists') if error.code == 1031: print("Insufficient