cx-oracle

How to install cx_Oracle on El Capitan

为君一笑 提交于 2019-12-29 07:45:07
问题 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>

Set a date variable to SQL query in Python [duplicate]

匆匆过客 提交于 2019-12-25 11:14:20
问题 This question already has an answer here : How to pass variable values dynamically in pandas sql query (1 answer) Closed 11 months ago . I want to do sql query in python. I could use cx_oracle to connection database in python: # Build connection conn_str = u'username/password@host:1521/sid' conn = cx_Oracle.connect(conn_str) Now I'm trying to retrieve data from the database by using SQL query in Python: sql_select_statement = """SELECT * FROM TABLE WHERE DATE BETWEEN '20-oct-2017' AND '30-oct

Set a date variable to SQL query in Python [duplicate]

一个人想着一个人 提交于 2019-12-25 11:13:49
问题 This question already has an answer here : How to pass variable values dynamically in pandas sql query (1 answer) Closed 11 months ago . I want to do sql query in python. I could use cx_oracle to connection database in python: # Build connection conn_str = u'username/password@host:1521/sid' conn = cx_Oracle.connect(conn_str) Now I'm trying to retrieve data from the database by using SQL query in Python: sql_select_statement = """SELECT * FROM TABLE WHERE DATE BETWEEN '20-oct-2017' AND '30-oct

Set a date variable to SQL query in Python [duplicate]

元气小坏坏 提交于 2019-12-25 11:11:44
问题 This question already has an answer here : How to pass variable values dynamically in pandas sql query (1 answer) Closed 11 months ago . I want to do sql query in python. I could use cx_oracle to connection database in python: # Build connection conn_str = u'username/password@host:1521/sid' conn = cx_Oracle.connect(conn_str) Now I'm trying to retrieve data from the database by using SQL query in Python: sql_select_statement = """SELECT * FROM TABLE WHERE DATE BETWEEN '20-oct-2017' AND '30-oct

Python cx_Oracle prepared statement with qmark

梦想的初衷 提交于 2019-12-25 08:59:53
问题 I am trying to work with cx_Oracle, but it seems to dislike what I know about db-api. These statement work: cur.execute('INSERT INTO "testdboz" ("id", "sessionid") VALUES (2, 123)') cur.execute('INSERT INTO "testdboz" ("id", "sessionid") VALUES (:id, :sid)', {'id':1, 'sid':13}) cur.execute('INSERT INTO "testdboz" ("id", "sessionid") VALUES (:1, :2)', [1123, 123]) However, this fails: cur.execute('INSERT INTO "testdboz" ("id", "sessionid") VALUES (?, ?)', [1, 123]) The above fails with: ------

Tell me how to access OracleDB from Raspberry Pi through QUERY [duplicate]

眉间皱痕 提交于 2019-12-25 02:47:24
问题 This question already has answers here : Raspberry pi No module named 'cx_Oracle' (2 answers) Closed 2 months ago . The problem is the link between raspberry pie and Oracle database. We've tried a lot of things now, but the problem isn't solved. After downloading the oracleinstantclient-32bit Basic files and sqlplus files via the web from the raspberry pie, unpack the file collection and set the absolute path export LD_LIBRARY_PATH and PATH as well. But always: cx_Oracle.DatabaseError: DPI

pushing complete python list to oracle db using cx_Oracle

瘦欲@ 提交于 2019-12-24 22:44:37
问题 I have two list having 100 elements in each (say class_db_col , and class_id_col ). I want to push all the items in class_db_col list to one column (say class_result ) present in oracle DB. statement = 'update TRANSFERS_TXN_MT set CLASS_RESULT = :1 where id= :2' for i in range(len(class_db_col)): cursor.execute(statement,(class_id_col[i],class_db_col[i])) conn.commit() getting this error ORA-01484: arrays can only be bound to PL/SQL statement can anyone help me with this problem? 回答1: If you

command 'gcc' failed with exit status 1 while installing cx_Oracle on windows 64 bit

允我心安 提交于 2019-12-24 13:51:19
问题 I'm trying to install cx_Oracle on my Windows 7 - 64 bit version. I previously had a question here about installing cx_Oracle on Windows and I solved the issue by myself; but it was a 32 bit version of Windows 7; here I faced a new problem installing it. I should mention that I deployed 64 bit version of MinGW and also Microsoft Visual Studio 2008 . For both I got command 'gcc' failed with exit status 1 . I tried easy_install cx_Oracle in Microsoft Visual Studio 2008 console and I got this

why system login is denied in cx_Oracle.SYSDBA mode

余生颓废 提交于 2019-12-24 08:06:26
问题 I am trying to connect to Oracle 12c through cx_Oracle module. Login using following code works where no mode is mentioned in cx_Oracle.connect method import cx_Oracle ip = 'ip' port='1521' SID='orcl' dsn_tns = cx_Oracle.makedsn(ip, port, SID) db = cx_Oracle.connect('system', 'password', dsn_tns) but for following way it shows invalid login error for cx_Oracle.SYSDBA mode. db = cx_Oracle.connect('system', 'password', dsn_tns, cx_Oracle.SYSDBA) Error: cx_Oracle.DatabaseError: ORA-01017:

How to get custom object from callfunc in cx_Oracle?

我们两清 提交于 2019-12-24 07:35:30
问题 I have an PL/SQL function my_function that returns custom defined object: CREATE OR REPLACE TYPE "TP_ACTION" AS OBJECT (   stop_time timestamp,   user_name varchar2(64),   error_msg tp_message_l, CONSTRUCTOR FUNCTION TP_ACTION(    usrnm in varchar2 := null ) RETURN SELF AS RESULT,   MEMBER PROCEDURE doClose(pi_session_MD5 IN  VARCHAR2),   member procedure setRunStatus(status in varchar2), ) Therefore in python I call that function: var_type = cursor.var(cx_Oracle.OBJECT, typename='TP_ACTION')