cx-oracle

Python – PySimpleGUI – OracleDB – Input text passed into Oracle statement

Python – PySimpleGUI – OracleDB – Input text passed into Oracle statement Question: I’ve made a simple Python app where I want two text fields ‘ID’ and ‘TEXT’ to be passed into the Oracle insert statement. The app opens correctly and the functions appear to work however the inputtext from those fields are not being …

Total answers: 3

Unable to install cx_Oracle with pip

Unable to install cx_Oracle with pip Question: I am currently using the latest version of Python and attempting to install cx_Oracle through the command pip install cx_Oracle. On my first attempt, I encountered an error that stated: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools". To address this, …

Total answers: 1

"inconsistent datatypes: expected DATE got CLOB" with .to_sql() to Oracle

"inconsistent datatypes: expected DATE got CLOB" with .to_sql() to Oracle Question: I’m attempting to automate a data insert into an Oracle database using data from an excel file. I put my data into a dataframe and have been able to get the statement to look right but I’m getting errors or when I don’t I …

Total answers: 1

How to reuse bind variables in oracledb-python?

How to reuse bind variables in oracledb-python? Question: I’m trying to do an upsert with below query but I’m getting oracledb.exceptions.DatabaseError: DPY-4009: 11 positional bind values are required but 5 were provided. Meaning I’m unable to reuse my bind variables. UPDATE Competition SET abbreviation = :1, descriptions = :2, levels = :3, source = :4, …

Total answers: 1

Freezing/hanging when executing Oracle DB PL/SQL procedure in Python

Freezing/hanging when executing Oracle DB PL/SQL procedure in Python Question: Hello I created a PLSQL procedure to update or insert quantity in inventory table based on product Id and new inward qty. Below is my PLSQL procedure and it works fine when i try in sql developer. But when i trying to execute this in …

Total answers: 1

how do i access one record from query results in python

how do i access one record from query results in python Question: hi i have this query and its result i was trying to access record by record at a time but im not able to select_migration_db = "SELECT B.rmt_n, A.prr_id, A.rp_ID FROM mo_TRAC A, T_sft_init_prr B WHERE A.rp_id=B.int_prr_id AND A.STATUS=’Sc’ AND A.PHASE=’first’ AND A.WAVE=’first’" …

Total answers: 2

cx_Oracle SELECT statement with WHERE clause and single quote

cx_Oracle SELECT statement with WHERE clause and single quote Question: import cx_Oracle dsn_tns = cx_Oracle.makedsn(‘**********’, ‘*******’, service_name=’***’) conn = cx_Oracle.connect(user=’******’, password=’*******’, dsn=dsn_tns) c = conn.cursor() c.execute(‘select username,created from dba_users where username=’USERNAME’ ‘) for row in c: print (row[0], ‘-‘, row[1]) # this only shows the first two columns. To add an additional column you’ll need …

Total answers: 2

Runtime variable for Oracle DATE type in Airflow

Runtime variable for Oracle DATE type in Airflow Question: I’m trying to define task that requires a run-time parameter (let’s call it ‘batch_dt’) in Apache Airflow. I’m using OracleStoredProcedureOperator and the parameter of the procedure is of database type date. procedure use_dates ( i_date in date, i_date2 in date, i_date3 in date ); However I’m …

Total answers: 2

How to i read the contents of Oracle stored procedures using Python

How to i read the contents of Oracle stored procedures using Python Question: I am trying to read the contents/code of a stored procedure using python. i used cx_Oracle function to establish the connection with oracle database. here is the code import cx_Oracle as co import pandas as pd dsn_tsn = co.makedsn(ip,port,SID) db=co.connect(username,password,dsn_tsn) cursor = …

Total answers: 3