cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Python call a store procedure

mjocasio
Explorer
0 Likes
289

I have statement to call a store procedure using python.... The store procedure executes an insert  statement .

but the call seems not to do anything.....

def execute_proc(self, sql_statement):
"""
Execute a Store Procedure.
"""
try:
cursor = self.connection.cursor()
cursor.execute("SET SCHEMA HISTDBA")
cursor.callproc(sql_statement)
self.connection.commit()
cursor.close()
print(f"Executed SQL: {sql_statement}")
except Exception as err:

This the code i used to call store procedure. I am able to call the procedure from studio. I also add it the select permission to the account used to execute the python code.
print(f"Error executing SQL: {err}")
raise

Accepted Solutions (0)

Answers (0)