How manipulate query results from cx_Oracle

I've trying to create a list with the results from a column. I execute the query and the result are okay, but when I input the data in a list using 'list.append' they return just '[]'. import cx_Oracle con = cx_Oracle.connect('user/psw@localhost') ...
more »

2017-08-08 22:08 (2) Answers

Python cx_Oracle invalid option

I'm trying to use Python to create a table and insert some values cur = con.cursor() remove_table = ''' BEGIN EXECUTE IMMEDIATE 'DROP TABLE {}'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF; END; ''' c...
more »

2017-06-16 19:06 (1) Answers

sqlalchemy create_engine issue with oracle

I am trying to connect to my Oracle DB and I can not create the engine: engine = create_engine('oracle://user:pass@localhost:1521/dbname') the error I get is: /anaconda2/lib/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyc in __in...
more »

2017-04-28 16:04 (1) Answers

Error Passing Variable to SQL Query Python

Error message 'Execution failed on sql ... expecting string, unicode or buffer object' is returned when trying to pass a Python string variable to a SQL query using cx_Oracle. Any help on this issue is greatly appreciated, thanks! import pandas as p...
more »

2017-04-13 23:04 (2) Answers

IntegrityError: ORA-01400: cannot insert NULL into

I'm trying to parse the following parameters into cursor.execute: sql_insert = 'insert into sms_messaging (result_sms, msgid, msgparts) values (:1, :2, :3)' smsreport_text_new = ('success', '2D67C865FB6FA25A9261C75E8D2F0F2B ', 1) cursor.execute(sql...
more »

2017-04-06 13:04 (3) Answers

cx_Oracle connection by python3.5

I've tried several attempt to connect Oracle DB but still unable to connect. Following is my code to connect. However, I could connect Oracle DB through the terminal like this: $ sqlplus64 uid/passwd@192.168.0.5:1521/WSVC My evironment: Ubuntu 16....
more »

2017-03-28 09:03 (1) Answers

Import column from Oracle to Python

Can what I asked in my title be done? I would ultimately like to compare a value in Python to all the values in a column in my Oracle table, so I've attempted the following: select_statement = ("SELECT STOCK_ID FROM FISHTABLE") cursor.execute(selec...
more »

2017-02-06 21:02 (0) Answers