Why the need to commit explicitly when doing an UPDATE?

前端 未结 3 2173
迷失自我
迷失自我 2020-12-03 21:50

Here\'s my code:

import cx_Oracle

conn = cx_Oracle.connect(usr, pwd, url)
cursor = conn.cursor()
cursor.execute(\"UPDATE SO SET STATUS=\'PE\' WHERE ID=\'100         


        
3条回答
  •  死守一世寂寞
    2020-12-03 22:30

    commit is used to tell the database to save all the changes in the current transaction.

    Select does not change any data so there is nothing to save and thus nothing to commit

    See wikipedia for transactions

提交回复
热议问题