Press "Enter" to skip to content

How to Save Data in Oracle Database Using Python?

Use connection.commit() method to save data in Oracle Database using Python. The below is an example:

Save Data in Oracle Database Using Python Example

In the following Python program, it will create the connection using the cx_Oracle library in variable CONN and then will execute an update statement to update EMP table’s comm column. After that, before closing the Oracle database connection, it will save the changes using the COMMIT() method.

import cx_Oracle

conn = cx_Oracle.connect("scott", "tiger", "localhost:1521/orcl")

cur = conn.cursor()

cur.execute('update emp set comm = sal * 10 / 100')


See also:

Have you found the answer to your question? If not, you can discuss it with me in the comments section below or join my Q&A community for developers and ask your question. It is FREE.

Vinish Kapoor


Hi, I am a full stack developer and writing about development. I document everything I learn and help thousands of people. is created, written, and maintained by me; it is built on WordPress, and hosted by Bluehost. Connect with me on Facebook, Twitter, GitHub, and get notifications for new posts.

Newest Most Voted
Inline Feedbacks
View all comments
Imran Syed
Imran Syed
2 months ago


I need python script to pull the data from Oracle database and insert into Postgresql database.

could you please help me.