Others explained why commit is not required in a SELECT statement. I just wanted to indicate that you can use the property autocommitof the Connection object to avoid having to manually commit:
import cx_Oracle
with cx_Oracle.connect(usr, pwd, url) as conn:
conn.autocommit = True
cursor = conn.cursor()
cursor.execute("UPDATE SO SET STATUS='PE' WHERE ID='100'")
cursor.close()
This is especially useful if there are several INSERT, UPDATE, and DELETE statements in the same connection.
source
share