cx-oracle

easy_install cx_Oracle (python package) on Windows

久未见 提交于 2019-11-26 21:18:14
问题 So I found Help installing cx_Oracle but am still stuck. I downloaded the latest instantclient from oracle, and set ORACLE_HOME to the location of the extracted files (both direct and with a bin folder between the ORACLE_HOME value and the files), but easy_install is popping an error when running setup.py saying it can't locate the Oracle include files. I did notice that only the 11g dll is in the folder, do I need all 3 drivers present for setup to complete? If so, where do I even get them?

cx_Oracle: ImportError: DLL load failed: This application has failed

孤者浪人 提交于 2019-11-26 20:54:29
问题 Here's what I did: I'm on Windows XP SP3 I already had Python 2.7.1 installed. I downloaded instantclient-basic-nt-11.2.0.3.0.zip , unzipped it, and put it in C:\Program Files\Oracle\instantclient_11_2 . I added this path to the Windows Path environment variable. I created a new environment variable ORACLE_HOME holding this path as its value. I installed cx_Oracle-5.1.2-11g.win32-py2.7.msi . And on running import cx_Oracle all I get is Traceback (most recent call last): File "<string>", line

Python cx_Oracle bind variables

瘦欲@ 提交于 2019-11-26 17:44:09
问题 I am a Python newbie, I am having troubles in the use of bind variables. If I execute the code below everything works fine. bind= {"var" : "ciao"} sql = "select * from sometable where somefield = :bind" cur.prepare(sql) cur.execute(sql,bind) Instead if I add another bind variable I obtain an error. bind= {"var" : "ciao"} sql = "select * from sometable where somefield = :bind and otherfield = :bind" cur.prepare(sql) cur.execute(sql,(bind,bind)) cur.execute(sql,(bind,bind)) Oracle

How can I do a batch insert into an Oracle database using Python?

时光毁灭记忆、已成空白 提交于 2019-11-26 14:08:30
问题 I have some monthly weather data that I want to insert into an Oracle database table but I want to insert the corresponding records in a batch in order to be more efficient. Can anyone advise as to how I'd go about doing this in Python? For example let's say my table has four fields: a station ID, a date, and two value fields. The records are uniquely identified by the station ID and date fields (composite key). The values I'll have to insert for each station will be kept in a list with X