Insert values to the oracle table using python cx_oracle Session Pool
NickName:Rahul Ask DateTime:2022-03-20T02:21:53

Insert values to the oracle table using python cx_oracle Session Pool

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

More about “Insert values to the oracle table using python cx_oracle Session Pool” related questions

Insert values to the oracle table using python cx_oracle Session Pool

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 N...

Show Detail

How to create a connection (or session) pool in python multiprocessing code using cx_Oracle to connect to a Oracle database?

I have a very lengthy multiprocessing python code which involves interaction with the Oracle database several times during the run. The code is supposed to be an independent application which will ...

Show Detail

Dynamically using INSERT for cx_Oracle - Python

I've been looking around so hopefully someone here can assist: I'm attempting to use cx_Oracle in python to interface with a database; my task is to insert data from an excel file to an empty (but

Show Detail

Why does insert script using cx_Oracle hangs

I'm new to Python, using cx_Oracle.execute to insert a row into a table. I prepare the insert statement, which works on SQL developer. print statements prior to the execute indicate it hangs on e...

Show Detail

Using a Python dict for a SQL INSERT statement for CX_ORACLE

convert a dictionary to SQL insert for the cx_Oracle driver in Python custom_dictionary= {'ID':2, 'Price': '7.95', 'Type': 'Sports'} I'm need making dynamic code sql insert for cx_O

Show Detail

Hang using INSERT in cx_Oracle with Python

I'm using python 3.8.10 and cx_oracle 8.0.1 on windows 7 when connecting to the database, I can run "select" normally but when trying to execute any "insert" python is processing

Show Detail

Python cx_Oracle Insert Timestamp With Milliseconds

I have read the posts: Insert TIMESTAMP with milliseconds in Oracle with cx_Oracle and Python 3.6 and sqlserver datetime to oracle timestamp problems , but none of them solved my problem. Because,

Show Detail

Insert 185 columns with 7L rows in to Oracle sql table using Python Cx_Oracle

I want to insert 185 columns consisting of 7L rows from a CSV file in to a Oracle Sql table using Python. I have used Cx_oracle to connect to Oracle DB. I know how to insert data in to table using ...

Show Detail

Insert 185 columns with 7L rows in to Oracle sql table using Python Cx_Oracle

I want to insert 185 columns consisting of 7L rows from a CSV file in to a Oracle Sql table using Python. I have used Cx_oracle to connect to Oracle DB. I know how to insert data in to table using ...

Show Detail

Insert TIMESTAMP with milliseconds in Oracle with cx_Oracle and Python 3.6

I need to insert a timestamp with milliseconds in an Oracle table with Python 3.6 and cx_Oracle 6.4.1. The insert is done okay but I am losing the milliseconds on the way. The timestamp is passed ...

Show Detail