I am trying to connect to oracle database using cx_Oracle in python. I am able to connect to the database and pull the data.
Now I am trying to connect to one more database where I have to call a security procedure first and then only I can see data in the underlying tables. Can you please help me in calling the procedure by adjusting the below block of code. My procedure will be like: exec ef.applogin('1234')
def connect_oracle():
import cx_Oracle
import pandas as pd
ip = 'some_ip'
port = 1521
SID = 'some_SID'
dsn_tns = cx_Oracle.makedsn(ip, port, SID)
connection = cx_Oracle.connect('user_name', 'password', dsn_tns)
#Procedure to be executed here..
query = """ SELECT * from table_name """
df_ora = pd.read_sql(query, con=connection)
return df_ora
connect_oracle()
Many thanks in advance!!