Can any one help how to insert a single row into the oracle table using the python cx_oracle Session Pool? I am seeing some issue with the below code.
Type error: expecting string or object
Name Null? Type
---- ----- ------------
ID NUMBER(38)
NAME VARCHAR2(30)
def connections():
pool = cx_Oracle.SessionPool(user='system',password='oracle',dsn='localhost/orcl', min=5, max=5)
connection = pool.acquire()
cur = connection.cursor()
return cur
def update_table(cursor):
rows=[(2,"KRR")]
sql=("insert into exm(id,name) values(:1, :2)", rows)
cursor.execute(sql)
Copyright Notice:Content Author:「Rahul」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/71540871/insert-values-to-the-oracle-table-using-python-cx-oracle-session-pool